/*
  OpenFeed reference client, design study v0.2 (9 October 2026)
  Shared stylesheet for index.html (home), profile.html and space.html.
  Layout concept: one app shell on every page. Sidebar for navigation,
  one content column, a right rail for spaces and suggestions.
  Below 700px the sidebar becomes a bottom tab bar.
*/

:root {
  --bg: #EDF0F5;
  --surface: #FFFFFF;
  --surface-2: #E2E7EF;
  --hover: #F4F6FA;
  --ink: #0F1B2D;
  --muted: #536075;
  --line: #D6DCE6;
  --accent: #2341D6;
  --accent-ink: #FFFFFF;
  --accent-soft: #DCE2FF;
  --gold: #8F6200;
  --gold-soft: #F6EBCB;
  --like: #C8264F;
  --repost: #1C7A52;
  --danger: #B42318;
  --scrim: rgba(8, 14, 24, 0.5);
  --shadow: rgba(15, 27, 45, 0.18);

  --font-display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A1019;
    --surface: #111A27;
    --surface-2: #1B2638;
    --hover: #152131;
    --ink: #E6EBF3;
    --muted: #9AA6BA;
    --line: #243146;
    --accent: #8399FF;
    --accent-ink: #0A1019;
    --accent-soft: #1C2750;
    --gold: #F0C54A;
    --gold-soft: #3A2F12;
    --like: #FF7A9A;
    --repost: #4CC593;
    --danger: #FF8A7A;
    --scrim: rgba(0, 0, 0, 0.62);
    --shadow: rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A1019;
  --surface: #111A27;
  --surface-2: #1B2638;
  --hover: #152131;
  --ink: #E6EBF3;
  --muted: #9AA6BA;
  --line: #243146;
  --accent: #8399FF;
  --accent-ink: #0A1019;
  --accent-soft: #1C2750;
  --gold: #F0C54A;
  --gold-soft: #3A2F12;
  --like: #FF7A9A;
  --repost: #4CC593;
  --danger: #FF8A7A;
  --scrim: rgba(0, 0, 0, 0.62);
  --shadow: rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* Cross-page transitions (browsers that support them) */
@view-transition { navigation: auto; }
.sidebar { view-transition-name: sidebar; }
.rail { view-transition-name: rail; }
.bottombar { view-transition-name: bottombar; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* No visible scrollbars anywhere: the page, the sheet and the rail still scroll */
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }
html:has(dialog[open]) { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Shell ---------- */
.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 620px) 320px;
  justify-content: center;
  column-gap: 24px;
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: 16px;
}
.main {
  min-width: 0;
  min-height: 100dvh;
  background: var(--surface);
  border-inline: 1px solid var(--line);
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-block: 14px;
  min-width: 0;
}
.side-brand { display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px 18px; font: 800 1.25rem/1 var(--font-display); letter-spacing: -0.03em; }
.side-brand .tld { color: var(--muted); font-weight: 500; }
.logo { width: 26px; height: 26px; flex: none; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  padding: 11px 14px;
  border: 0; border-radius: 999px; background: none;
  font: 500 1.0625rem/1.2 var(--font-body);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background-color .15s ease;
}
.nav-item .ic { width: 24px; height: 24px; }
.nav-item:hover { background: var(--surface-2); }
.nav-item[aria-current="page"] { font-weight: 700; }
.nav-item[aria-current="page"] .ic { stroke-width: 2.4; color: var(--accent); }
.nbadge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font: 600 0.75rem/20px var(--font-body); text-align: center;
  margin-left: auto;
}
.side-post {
  margin-top: 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 14px 18px;
  background: var(--accent); color: var(--accent-ink);
  font: 700 1rem/1 var(--font-body); cursor: pointer;
  transition: transform .15s var(--ease-out), box-shadow .15s ease;
}
.side-post:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -10px var(--accent); }
.side-post:active { transform: scale(.97); }
.side-foot { margin-top: auto; display: grid; gap: 4px; }
.me-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 999px; transition: background-color .15s ease; min-width: 0; }
.me-card:hover { background: var(--surface-2); }
.me-card .label { display: grid; min-width: 0; line-height: 1.25; }
.me-card strong { font-weight: 600; font-size: 0.9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-card .handle { font-size: 0.8125rem; }

/* Right rail */
.rail {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  align-self: start;
  display: grid;
  gap: 16px;
  padding-block: 12px 24px;
  min-width: 0;
}
.search { position: relative; display: flex; align-items: center; }
.search .ic { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; border: 1px solid transparent; background: var(--surface-2); color: var(--ink);
  border-radius: 999px; padding: 11px 16px 11px 42px; font: 0.9375rem/1.3 var(--font-body);
  transition: border-color .15s ease, background-color .15s ease;
}
.search input::placeholder { color: var(--muted); }
.search input:focus-visible { outline: none; border-color: var(--accent); background: var(--surface); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 0 8px; display: grid; }
.card h2 { font-size: 1.125rem; font-weight: 800; padding: 0 16px 8px; }
.rail-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 16px; transition: background-color .15s ease; }
a.rail-row:hover { background: var(--hover); }
.rail-row .t { min-width: 0; display: grid; line-height: 1.3; }
.rail-row .t strong { font-weight: 600; font-size: 0.9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-row .t span { font-size: 0.8125rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font: 600 0.75rem/22px var(--font-body); text-align: center; font-variant-numeric: tabular-nums; }
.rail-foot { padding: 0 6px; font-size: 0.8125rem; color: var(--muted); display: grid; gap: 6px; }
.rail-foot nav { display: flex; flex-wrap: wrap; gap: 4px 14px; }

/* Bottom bar (phones) */
.bottombar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  transition: transform .28s var(--ease-out);
}
.bottombar.is-hidden { transform: translateY(calc(100% + 4px)); }
.tab-item {
  position: relative;
  display: grid; justify-items: center; gap: 2px;
  border: 0; background: none; padding: 6px 0; cursor: pointer;
  color: var(--muted); font: 500 0.6875rem/1.1 var(--font-body);
}
.tab-item .ic { width: 24px; height: 24px; }
.tab-item[aria-current="page"] { color: var(--ink); }
.tab-item[aria-current="page"] .ic { stroke-width: 2.4; color: var(--accent); }
.tab-item .nbadge { position: absolute; top: 0; left: 50%; margin-left: 6px; min-width: 18px; height: 18px; line-height: 18px; font-size: 0.6875rem; padding: 0 5px; }
.tab-item .av { --s: 24px; font-size: 0.5625rem; }
.tab-item[aria-current="page"] .av { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.fab {
  display: none;
  position: fixed; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); z-index: 31;
  width: 56px; height: 56px; border-radius: 50%; border: 0;
  background: var(--accent); color: var(--accent-ink);
  place-items: center; cursor: pointer;
  box-shadow: 0 12px 28px -10px var(--accent);
  transition: transform .28s var(--ease-out);
}
.fab.bar-hidden { transform: translateY(64px); }
.fab .ic { width: 26px; height: 26px; stroke-width: 2.2; }
.fab:active { transform: scale(.9); }
.fab.bar-hidden:active { transform: translateY(64px) scale(.9); }

/* ---------- Page header ---------- */
.page-head {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .2s ease;
}
.page-head.scrolled { box-shadow: 0 8px 20px -18px var(--shadow); }
.head-row { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 6px 16px; }
.head-title { min-width: 0; display: grid; line-height: 1.2; }
.head-title h1 { font-size: 1.25rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-title span { font-size: 0.8125rem; color: var(--muted); }
.head-logo { display: none; margin-inline: auto; }
.head-me { display: none; }
.icon-round {
  flex: none; width: 38px; height: 38px; border-radius: 50%; border: 0; background: none;
  display: grid; place-items: center; cursor: pointer; color: var(--ink);
  transition: background-color .15s ease, transform .15s ease;
}
.icon-round:hover { background: var(--surface-2); }
.icon-round:active { transform: scale(.92); }
.head-spacer { width: 32px; flex: none; }

/* Filter chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 7px 12px; font: 500 0.875rem/1 var(--font-body); cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .15s ease;
}
.chip .ic { width: 15px; height: 15px; color: var(--muted); }
.chip:active { transform: scale(.95); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip[aria-pressed="true"] .ic { color: var(--bg); }

/* ---------- Avatars ---------- */
.av {
  --s: 44px;
  width: var(--s); height: var(--s); flex: none;
  border-radius: 50%;
  background: var(--av, #536075); color: #FFFFFF;
  display: grid; place-items: center;
  font: 700 calc(var(--s) * 0.36)/1 var(--font-body);
  user-select: none;
}
.av-org { border-radius: 28%; }
.sav {
  --s: 40px;
  width: var(--s); height: var(--s); flex: none;
  border-radius: 26%;
  background: var(--av); color: #FFFFFF;
  display: grid; place-items: center;
  font: 800 calc(var(--s) * 0.36)/1 var(--font-display); letter-spacing: -0.02em;
  user-select: none;
}
.av-link { display: inline-flex; border-radius: 50%; flex: none; transition: transform .15s ease, filter .15s ease; align-self: start; }
.av-link:hover { filter: brightness(1.06); }
.av-link:active { transform: scale(.94); }

/* ---------- Composer ---------- */
.composer { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.sheet .composer { border-bottom: 0; }
.compose-main { display: grid; gap: 10px; min-width: 0; }
.compose-main textarea {
  width: 100%; min-height: 3.6em; resize: none; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: var(--ink); font: 1.0625rem/1.5 var(--font-body); padding: 8px 0 10px;
  field-sizing: content; max-height: 40vh;
  transition: border-color .2s ease;
}
.sheet .compose-main textarea { min-height: 6em; }
.compose-main textarea::placeholder { color: var(--muted); }
.compose-main textarea:focus-visible { outline: none; border-bottom-color: var(--accent); }
.compose-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 10px; }
.audience { display: flex; gap: 6px; align-items: flex-start; font-size: 0.8125rem; color: var(--muted); }
.audience .ic { width: 15px; height: 15px; margin-top: 2px; }
.select-wrap { position: relative; display: inline-flex; align-items: center; min-width: 0; max-width: 100%; }
.select-wrap .ic { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--accent); pointer-events: none; }
.select-wrap select, .fixed-target {
  appearance: none; -webkit-appearance: none; max-width: 100%;
  border: 1px solid var(--line); background-color: var(--surface); color: var(--accent);
  font: 600 0.875rem/1.2 var(--font-body); border-radius: 999px; padding: 7px 28px 7px 31px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 14px center, right 9px center; background-size: 5px 5px; background-repeat: no-repeat;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fixed-target { cursor: default; background-image: none; padding-right: 14px; }
.compose-send { display: inline-flex; align-items: center; gap: 12px; margin-left: auto; }
.ring { width: 26px; height: 26px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring .track { stroke: var(--surface-2); }
.ring .bar { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .15s ease, stroke .2s ease; }
.ring.warn .bar { stroke: var(--gold); }
.ring.over .bar { stroke: var(--danger); }
.count-left { font: 500 0.8125rem/1 var(--font-mono); color: var(--muted); font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right; }
.count-left.over { color: var(--danger); }
.btn {
  border: 0; border-radius: 999px; padding: 10px 18px; cursor: pointer;
  font: 600 0.9375rem/1 var(--font-body);
  background: var(--accent); color: var(--accent-ink);
  transition: transform .15s var(--ease-out), opacity .15s ease;
}
.btn:active:not(:disabled) { transform: scale(.96); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { padding: 8px 14px; font-size: 0.875rem; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: var(--danger); color: #FFFFFF; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-danger { color: #0A1019; } }
:root[data-theme="dark"] .btn-danger { color: #0A1019; }

/* Composer options */
.compose-tools { display: flex; flex-wrap: wrap; gap: 2px; margin-left: -8px; }
.tool {
  position: relative; width: 36px; height: 36px; border-radius: 50%; border: 0; background: none;
  color: var(--accent); display: grid; place-items: center; cursor: pointer;
  transition: background-color .15s ease, transform .15s var(--ease-out), color .15s ease;
}
.tool .ic { width: 20px; height: 20px; }
.tool:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.tool:active { transform: scale(.88); }
.tool.is-on, .tool[aria-expanded="true"] { background: var(--accent-soft); }
.tool.is-on::after { content: ""; position: absolute; right: 5px; top: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.tool[data-tool="cw"].is-on { color: var(--gold); background: var(--gold-soft); }
.tool[data-tool="cw"].is-on::after { background: var(--gold); }
.tool[aria-disabled="true"] { opacity: .35; cursor: not-allowed; }
.tool[aria-disabled="true"]:hover { background: none; }
.compose-right { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; margin-left: auto; min-width: 0; }
@keyframes open-down { from { opacity: 0; transform: translateY(-6px); } }
.cw-field, .attach, .poll-edit, .compose-panel, .flags { animation: open-down .22s var(--ease-out); }
.cw-field { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--gold-soft); color: var(--gold); }
.cw-field .ic { width: 18px; height: 18px; }
.cw-field input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: 500 0.9375rem/1.4 var(--font-body); padding: 2px 0; }
.cw-field input::placeholder { color: color-mix(in srgb, var(--gold) 70%, var(--muted)); }
.cw-field input:focus-visible { outline: none; }
.cw-field:focus-within { box-shadow: 0 0 0 2px var(--gold); }
.attach { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.thumb { position: relative; margin: 0; display: grid; gap: 6px; animation: pop-in .25s var(--ease-spring); }
.thumb img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); display: block; }
.thumb-rm {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0;
  background: rgba(15, 27, 45, .72); color: #FFFFFF; display: grid; place-items: center; cursor: pointer;
  transition: transform .15s ease;
}
.thumb-rm:hover { transform: scale(1.08); }
.thumb-rm .ic { width: 15px; height: 15px; stroke-width: 2.4; }
.thumb input, .poll-opt-row input {
  width: 100%; min-width: 0; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 8px; padding: 6px 8px; font: 0.8125rem/1.3 var(--font-body);
}
.thumb input:focus-visible, .poll-opt-row input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.poll-edit { display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.poll-opts { display: grid; gap: 8px; }
.poll-opt-row { display: grid; grid-template-columns: minmax(0, 1fr) 32px; gap: 6px; align-items: center; animation: open-down .2s var(--ease-out); }
.poll-opt-row input { border-radius: 999px; padding: 9px 14px; font-size: 0.9375rem; }
.icon-round.sm { width: 32px; height: 32px; color: var(--muted); }
.icon-round.sm .ic { width: 16px; height: 16px; }
.icon-gap { width: 32px; }
.poll-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 0.875rem; }
.poll-foot .linkish { display: inline-flex; align-items: center; gap: 4px; font-size: 0.875rem; }
.poll-foot .linkish .ic { width: 15px; height: 15px; }
.poll-foot .danger { color: var(--danger); margin-left: auto; }
.poll-max { color: var(--muted); }
.poll-len { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.poll-len select { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 5px 8px; font: 500 0.875rem var(--font-body); }
.compose-panel { border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: var(--surface); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 2px; max-height: 172px; overflow-y: auto; }
.emoji-grid button { height: 38px; border: 0; background: none; border-radius: 8px; font-size: 1.35rem; line-height: 1; cursor: pointer; transition: background-color .12s ease, transform .12s var(--ease-spring); }
.emoji-grid button:hover { background: var(--surface-2); transform: scale(1.15); }
.emoji-grid button:active { transform: scale(.9); }
.panel-label { font-size: 0.8125rem; color: var(--muted); margin-bottom: 8px; }
.seg-row { display: flex; flex-wrap: wrap; gap: 6px; }
.flags { display: flex; flex-wrap: wrap; gap: 6px; }
.flag {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font: 500 0.8125rem/1.2 var(--font-body);
  animation: pop-in .2s var(--ease-out);
}
.flag .ic { width: 14px; height: 14px; }
.flag.warn { background: var(--gold-soft); color: var(--gold); }
.flag button { width: 22px; height: 22px; border: 0; border-radius: 50%; background: none; color: inherit; display: grid; place-items: center; cursor: pointer; }
.flag button:hover { background: color-mix(in srgb, currentColor 16%, transparent); }
.flag button .ic { width: 12px; height: 12px; stroke-width: 2.4; }
.composer.dragging { outline: 2px dashed var(--accent); outline-offset: -6px; border-radius: 16px; background: var(--hover); }

/* Post: content warning, images, poll, expiry, replies off */
.cw-bar {
  display: flex; align-items: center; gap: 10px; margin-top: 4px; padding: 10px 10px 10px 12px;
  border-radius: 12px; background: var(--gold-soft); color: var(--ink); font-size: 0.9375rem;
}
.cw-bar > .ic { width: 18px; height: 18px; color: var(--gold); }
.cw-bar strong { font-weight: 600; min-width: 0; flex: 1; overflow-wrap: anywhere; }
.cw-btn {
  flex: none; border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 6px 12px; font: 600 0.8125rem/1 var(--font-body); cursor: pointer;
  transition: transform .15s ease;
}
.cw-btn:active { transform: scale(.95); }
.cw-content { display: grid; gap: 4px; padding-top: 4px; animation: open-down .3s var(--ease-out); }
.imgs { display: grid; gap: 3px; margin: 6px 0 2px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--line); max-width: 100%; }
.imgs img { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--surface-2); }
.imgs.g1 img { max-height: 460px; height: auto; }
.imgs.g2, .imgs.g3, .imgs.g4 { aspect-ratio: 16 / 9; grid-template-columns: 1fr 1fr; }
.imgs.g3 { grid-template-rows: 1fr 1fr; }
.imgs.g3 img:first-child { grid-row: 1 / 3; }
.imgs.g4 { grid-template-rows: 1fr 1fr; }
.imgs.g2 img, .imgs.g3 img, .imgs.g4 img { min-height: 0; }
.poll { display: grid; gap: 6px; margin: 8px 0 2px; }
.poll-opt {
  border: 1.5px solid var(--accent); background: transparent; color: var(--accent);
  border-radius: 999px; padding: 9px 14px; font: 600 0.9375rem/1.2 var(--font-body); cursor: pointer;
  transition: background-color .15s ease, transform .15s var(--ease-out);
}
.poll-opt:hover { background: var(--accent-soft); }
.poll-opt:active { transform: scale(.98); }
.poll-res { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; overflow: hidden; font-size: 0.9375rem; }
.poll-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 10px; background: var(--surface-2); transition: width .6s var(--ease-out); }
.poll-res.lead .poll-fill { background: var(--accent-soft); }
.poll-label, .poll-pct { position: relative; display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.poll-label .ic { width: 17px; height: 17px; color: var(--accent); }
.poll-pct { font-variant-numeric: tabular-nums; color: var(--muted); }
.poll-res.lead .poll-pct, .poll-res.lead .poll-label { font-weight: 700; color: var(--ink); }
.poll.just .poll-fill { animation: grow .8s var(--ease-out); }
.poll.just .poll-res.mine .poll-label .ic { animation: heart .45s var(--ease-spring) .3s backwards; }
@keyframes grow { from { width: 0; } }
.poll-meta { font-size: 0.8125rem; color: var(--muted); padding-top: 2px; }
.ttl-chip { display: inline-flex; align-items: center; gap: 3px; flex: none; margin-left: 6px; font: 500 0.75rem/1 var(--font-mono); color: var(--gold); }
.ttl-chip .ic { width: 13px; height: 13px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.detail-ttl { display: inline-flex; align-items: center; gap: 5px; color: var(--gold); }
.detail-ttl .ic { width: 15px; height: 15px; }
.replies-off { display: flex; align-items: center; gap: 8px; padding: 14px 0 10px; color: var(--muted); font-size: 0.875rem; }
.replies-off .ic { width: 17px; height: 17px; }

/* New posts pill */
.new-pill {
  position: sticky; top: calc(env(safe-area-inset-top, 0px) + 112px); z-index: 15;
  display: flex; justify-content: center; height: 0;
}
.new-pill button {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; margin-top: 10px;
  border: 0; border-radius: 999px; padding: 0 16px 0 6px;
  background: var(--accent); color: var(--accent-ink);
  font: 600 0.875rem/1 var(--font-body); cursor: pointer;
  box-shadow: 0 10px 26px -10px var(--accent);
  animation: drop-in .45s var(--ease-spring);
}
.new-pill .av { --s: 28px; border: 2px solid var(--accent); }
@keyframes drop-in { from { transform: translateY(-24px) scale(.9); opacity: 0; } }

/* ---------- Post ---------- */
.list { display: grid; }
.post {
  position: relative;
  display: grid; gap: 6px;
  padding: 14px 16px 8px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: background-color .15s ease, transform .18s var(--ease-out);
}
.list > .post:first-child { border-top: 0; }
.post:hover { background: var(--hover); }
.post:active:not(:has(button:active, a:active, input:focus, .menu:hover)) { transform: scale(.994); }
.post.is-opening { background: var(--accent-soft); }
.stagger > .post { animation: rise .42s var(--ease-out) backwards; }
.stagger > .post:nth-child(2) { animation-delay: .04s; }
.stagger > .post:nth-child(3) { animation-delay: .08s; }
.stagger > .post:nth-child(4) { animation-delay: .12s; }
.stagger > .post:nth-child(5) { animation-delay: .16s; }
.stagger > .post:nth-child(n+6) { animation-delay: .2s; }
@keyframes rise { from { opacity: .2; transform: translateY(10px); } }
.post.is-new, .reply.is-new { animation: arrive .6s var(--ease-out); }
@keyframes arrive {
  0% { opacity: 0; transform: translateY(-10px); background: var(--accent-soft); }
  40% { opacity: 1; transform: none; background: var(--accent-soft); }
  100% { background: transparent; }
}

.ctx-row { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: center; font-size: 0.8125rem; font-weight: 500; color: var(--muted); }
.ctx-row .ic { justify-self: end; width: 15px; height: 15px; }
.ctx-row > span { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ctx-row a:hover { text-decoration: underline; }
.space-link { color: var(--ink); font-weight: 600; }
.vis { font: 500 0.6875rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 6px; border-radius: 4px; white-space: nowrap; }
.vis-public { background: var(--surface-2); color: var(--muted); }
.vis-private { background: var(--gold-soft); color: var(--gold); }
.vis-organisation { background: var(--accent-soft); color: var(--accent); }

.post-grid { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; }
.post-main { min-width: 0; display: grid; gap: 4px; }
.post-head { position: relative; display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 0.9375rem; line-height: 1.3; }
.name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
a.name:hover { text-decoration: underline; }
.badge { display: inline-flex; flex: none; color: var(--accent); }
.badge .ic { width: 16px; height: 16px; }
.badge-verified .ic { fill: var(--accent); stroke: none; }
.handle { font: 0.8125rem/1.3 var(--font-mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 3 auto; }
.dot { color: var(--muted); flex: none; }
.time-btn { flex: none; border: 0; background: none; padding: 0; color: var(--muted); font: 0.875rem/1.3 var(--font-body); cursor: pointer; white-space: nowrap; }
.time-btn:hover { text-decoration: underline; }
.more-btn { flex: none; margin-left: auto; width: 34px; height: 34px; margin-block: -7px; margin-right: -6px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); border-radius: 50%; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.more-btn .ic { width: 18px; height: 18px; }
.more-btn:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.post-body { font-size: 1rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.mention, .hashtag { color: var(--accent); font-weight: 500; }
.linkish { justify-self: start; border: 0; background: none; padding: 2px 0; color: var(--accent); font: 500 0.8125rem/1.3 var(--font-body); cursor: pointer; }
.linkish:hover { text-decoration: underline; }
.tr-row { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 0.8125rem; color: var(--muted); }
.media { margin: 6px 0 2px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16 / 9; max-width: 100%; background: var(--surface-2); }
.media svg { display: block; width: 100%; height: 100%; }
.link-card { margin: 6px 0 2px; display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.lc-domain { font: 0.75rem/1.3 var(--font-mono); color: var(--muted); }
.link-card strong { font-size: 0.9375rem; line-height: 1.35; }
.lc-desc { font-size: 0.875rem; color: var(--muted); }

/* Detail view of a post */
.post.is-detail { cursor: default; padding-top: 16px; }
.post.is-detail:hover { background: transparent; }
.post.is-detail:active { transform: none; }
.post.is-detail > .post-grid .post-body { font-size: 1.1875rem; line-height: 1.5; margin-top: 6px; }
.post.is-detail .post-grid { grid-template-columns: 48px minmax(0, 1fr); }
.post.is-detail .post-main { grid-column: 1 / -1; }
.post.is-detail .post-grid > .av-link { grid-row: 1; }
.post.is-detail > .post-grid > .post-head { grid-column: 2; grid-row: 1; align-self: center; }
.detail-meta { color: var(--muted); font-size: 0.9375rem; padding-block: 10px 2px; }
.detail-stats { display: flex; flex-wrap: wrap; gap: 4px 18px; padding-block: 10px; border-block: 1px solid var(--line); font-size: 0.9375rem; color: var(--muted); margin-top: 8px; }
.detail-stats strong { color: var(--ink); font-variant-numeric: tabular-nums; margin-right: 4px; }

/* Actions */
.actions { display: flex; justify-content: space-between; max-width: 440px; margin: 2px 0 0 -8px; }
.is-detail > .post-grid > .post-main > .actions { max-width: none; margin-inline: 0; padding-block: 2px; border-bottom: 1px solid var(--line); }
.actions-sm { justify-content: flex-start; flex-wrap: wrap; gap: 0 12px; margin-top: 0; }
.act {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: none; color: var(--muted); cursor: pointer;
  padding: 7px 8px; border-radius: 999px;
  font: 500 0.8125rem/1 var(--font-body); font-variant-numeric: tabular-nums;
  transition: color .15s ease, background-color .15s ease;
}
.act .ic { width: 19px; height: 19px; transition: transform .2s var(--ease-out); }
.act .n { min-width: 2.5ch; text-align: left; display: inline-block; }
.act-reply:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.act-repost:hover, .act-repost.is-on { color: var(--repost); }
.act-repost:hover { background: color-mix(in srgb, var(--repost) 12%, transparent); }
.act-like:hover, .act-like.is-on { color: var(--like); }
.act-like:hover { background: color-mix(in srgb, var(--like) 12%, transparent); }
.act-save:hover, .act-save.is-on, .act-share:hover { color: var(--accent); }
.act-save:hover, .act-share:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.act:active .ic { transform: scale(.85); }
.act.is-on .ic { fill: currentColor; }
.act-repost.is-on .ic { fill: none; stroke-width: 2.4; }
.act[aria-disabled="true"] { opacity: .38; cursor: not-allowed; }
.act[aria-disabled="true"]:hover { background: none; color: var(--muted); }

/* Like: heart pops, a ring bursts, the number rolls */
.act-like.pop .ic { animation: heart .45s var(--ease-spring); }
.act-like.pop::before {
  content: ""; position: absolute; left: 8px; top: 50%; width: 19px; height: 19px; margin-top: -9.5px;
  border-radius: 50%; border: 2px solid var(--like); pointer-events: none;
  animation: burst .5s var(--ease-out) forwards;
}
.act-like.pop::after {
  content: ""; position: absolute; left: 17px; top: 50%; width: 3px; height: 3px; margin-top: -1.5px; border-radius: 50%;
  background: var(--like); pointer-events: none;
  box-shadow: 0 -14px 0 var(--like), 12px -7px 0 var(--like), 12px 7px 0 var(--like), 0 14px 0 var(--like), -12px 7px 0 var(--like), -12px -7px 0 var(--like);
  animation: sparks .55s var(--ease-out) forwards;
}
@keyframes heart { 0% { transform: scale(.6); } 55% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes burst { 0% { transform: scale(.3); opacity: .9; } 100% { transform: scale(1.9); opacity: 0; border-width: 0; } }
@keyframes sparks { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(1.3); opacity: 0; } }
.pop .n { animation: roll .32s var(--ease-out); }
@keyframes roll { from { transform: translateY(60%); opacity: 0; } }
.act-repost.pop .ic { animation: spin-half .45s var(--ease-out); }
@keyframes spin-half { from { transform: rotate(-180deg); } }
.act-save.pop .ic { animation: drop .4s var(--ease-spring); }
@keyframes drop { 0% { transform: translateY(-6px); } 100% { transform: none; } }

/* Menu */
.menu {
  position: absolute; right: -6px; top: calc(100% + 10px); z-index: 12; min-width: 210px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px;
  box-shadow: 0 18px 44px -18px var(--shadow); display: grid;
  transform-origin: top right;
  animation: pop-in .18s var(--ease-out);
  cursor: default;
}
@keyframes pop-in { from { opacity: 0; transform: scale(.92) translateY(-4px); } }
.menu button { display: flex; align-items: center; gap: 10px; border: 0; background: none; text-align: left; padding: 9px 10px; border-radius: 9px; font-size: 0.9375rem; cursor: pointer; }
.menu button .ic { width: 18px; height: 18px; }
.menu button:hover, .menu button:focus-visible { background: var(--hover); }
.menu .danger { color: var(--danger); }

/* Thread */
.thread { position: relative; display: grid; padding-left: 56px; margin-bottom: 4px; cursor: default; }
.is-detail .thread { padding-left: 0; margin-top: 4px; }
/* Branches. Lines run from avatar to avatar and never cross one.
   Siblings: a line from each avatar down to the next sibling.
   Children: indented 42px, joined to the parent line with a rounded elbow. */
.thread .thread { padding-left: 42px; margin-bottom: 0; }
.post.is-detail .thread .thread { padding-left: 42px; }
.reply-node { position: relative; display: grid; }
.reply { position: relative; }
.reply-node:has(+ .reply-node)::before {
  content: ""; position: absolute; left: 15px; top: 44px; bottom: -6px;
  width: 2px; border-radius: 2px; background: var(--line);
}
.reply-node.has-kids > .reply::after {
  content: ""; position: absolute; left: 15px; top: 44px; bottom: 0;
  width: 2px; background: var(--line);
}
.thread .thread > .reply-node:has(~ .reply-node)::after {
  content: ""; position: absolute; left: -27px; top: 0; bottom: 0;
  width: 2px; background: var(--line);
}
.thread .thread > .reply-node > .reply::before {
  content: ""; position: absolute; left: -27px; top: 0; width: 22px; height: 24px;
  border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); border-bottom-left-radius: 12px;
}
.reply:not(.removed) { cursor: pointer; transition: background-color .15s ease; }
.reply:not(.removed):hover { background: color-mix(in srgb, var(--accent-soft) 40%, transparent); }
.reply.is-opening { background: var(--accent-soft); }
.act-branch { color: var(--accent); }
.act-branch:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.act-branch .ic { width: 16px; height: 16px; }
.act-branch .n { min-width: 0; }
.removed-toggle { padding: 2px 0 6px 42px; font-size: 0.8125rem; }
.thread .thread > .thread-more { padding-left: 0; }

/* Focus view: earlier replies above, the focused one large, its branch below */
.ancestors { display: grid; margin: -4px 0 2px; }
.anc {
  position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; align-items: start;
  width: 100%; border: 0; background: none; padding: 6px 0 12px; text-align: left; color: inherit; font: inherit; cursor: pointer;
  border-radius: 10px; transition: background-color .15s ease;
}
.anc:hover { background: var(--hover); }
.anc::before { content: ""; position: absolute; left: 23px; top: 44px; bottom: -2px; width: 2px; border-radius: 2px; background: var(--line); }
.anc-av { display: grid; justify-items: center; }
.anc-main { min-width: 0; display: grid; gap: 2px; }
.anc-head { display: flex; align-items: baseline; gap: 6px; min-width: 0; font-size: 0.875rem; }
.anc-head strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.anc-head .handle { font-size: 0.75rem; }
.anc-time { color: var(--muted); font-size: 0.8125rem; white-space: nowrap; }
.anc-body { font-size: 0.9375rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.anc-removed { cursor: default; }
.anc-removed .tomb-ic { width: 32px; height: 32px; border-radius: 50%; border: 1px dashed var(--line); display: grid; place-items: center; color: var(--muted); }
.anc-removed .tomb-ic .ic { width: 15px; height: 15px; }
.anc-removed .anc-body { padding-top: 6px; font-style: italic; }
.focus-in { animation: focus-in .3s var(--ease-out); }
.focus-out { animation: focus-out .3s var(--ease-out); }
@keyframes focus-in { from { opacity: 0; transform: translateX(28px); } }
@keyframes focus-out { from { opacity: 0; transform: translateX(-28px); } }
.sheet-back[hidden] { display: none !important; }
.sheet-head .sheet-back { margin-left: -6px; }
.reply { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; padding: 8px 0 2px; border-radius: 10px; }
.reply .post-head { font-size: 0.875rem; }
.reply .post-body { font-size: 0.9375rem; }
.reply .time { color: var(--muted); font-size: 0.8125rem; white-space: nowrap; flex: none; }
.reply-main { min-width: 0; display: grid; gap: 2px; }
.removed { align-items: start; padding: 8px 0; }
.removed .tomb-ic { width: 32px; height: 32px; border-radius: 50%; border: 1px dashed var(--line); display: grid; place-items: center; color: var(--muted); background: var(--surface); position: relative; }
.removed .tomb-ic .ic { width: 15px; height: 15px; }
.removed p { font-size: 0.875rem; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; padding: 8px 12px; }
.removed p strong { color: var(--ink); font-weight: 600; }
.thread-more { justify-self: start; border: 0; background: none; color: var(--accent); font: 600 0.875rem/1.2 var(--font-body); padding: 8px 0; cursor: pointer; }
.thread-more:hover { text-decoration: underline; }
.reply-form { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0 6px; animation: rise .3s var(--ease-out); }
.reply-form input {
  width: 100%; min-width: 0; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: 999px; padding: 9px 14px; font: 0.9375rem/1.3 var(--font-body);
  transition: border-color .15s ease;
}
.reply-form input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.end-note { padding: 28px 16px 40px; text-align: center; color: var(--muted); font-size: 0.875rem; display: grid; gap: 4px; border-top: 1px solid var(--line); }
.end-note strong { color: var(--ink); font-family: var(--font-display); font-size: 1.0625rem; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); display: grid; gap: 6px; justify-items: center; }
.empty strong { color: var(--ink); font-family: var(--font-display); font-size: 1.125rem; }
.empty .ic { width: 28px; height: 28px; color: var(--muted); margin-bottom: 4px; }

/* ---------- Hero (profile and space) ---------- */
.hero-img { position: relative; aspect-ratio: 3 / 1; max-width: 100%; overflow: hidden; background: var(--surface-2); }
.hero-img svg { display: block; width: 100%; height: 100%; transform: translate3d(0, var(--py, 0px), 0) scale(1.08); transform-origin: center bottom; will-change: transform; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding-inline: 16px; margin-top: -54px; position: relative; }
.hero-av { --s: 108px; border: 4px solid var(--surface); font-size: 2.2rem; animation: av-in .5s var(--ease-spring) backwards .05s; }
.sav.hero-av { font-size: 2.1rem; }
@keyframes av-in { from { transform: scale(.85); opacity: 0; } }
.hero-actions { display: flex; gap: 8px; padding-bottom: 4px; }
.round-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: border-color .15s ease, transform .15s ease, color .15s ease; }
.round-btn .ic { width: 18px; height: 18px; }
.round-btn:hover { border-color: var(--ink); }
.round-btn:active { transform: scale(.92); }
.round-btn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.round-btn[aria-pressed="true"] .ic { fill: currentColor; }

.toggle-btn {
  position: relative; min-width: 108px; height: 40px; padding: 0 18px;
  border: 1px solid var(--ink); border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font: 600 0.9375rem/1 var(--font-body); cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .15s ease;
}
.toggle-btn:active { transform: scale(.96); }
.toggle-btn .on-hover { display: none; }
.toggle-btn[aria-pressed="true"] { background: transparent; color: var(--ink); border-color: var(--line); }
.toggle-btn[aria-pressed="true"]:hover, .toggle-btn[aria-pressed="true"]:focus-visible { color: var(--danger); border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); }
.toggle-btn[aria-pressed="true"]:hover .on-label, .toggle-btn[aria-pressed="true"]:focus-visible .on-label { display: none; }
.toggle-btn[aria-pressed="true"]:hover .on-hover, .toggle-btn[aria-pressed="true"]:focus-visible .on-hover { display: inline; }
.toggle-btn.is-edit { background: transparent; color: var(--ink); border-color: var(--line); }
.toggle-btn.is-edit:hover { border-color: var(--ink); }
.toggle-btn.is-locked { background: transparent; color: var(--muted); border-color: var(--line); cursor: help; }
.toggle-sm { min-width: 0; height: 32px; padding: 0 14px; font-size: 0.8125rem; }

.hero-info { padding: 12px 16px 14px; display: grid; gap: 12px; }
.hero-id { display: grid; gap: 4px; }
.hero-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: 800 1.5rem/1.15 var(--font-display); letter-spacing: -0.02em; }
.hero-name .badge .ic { width: 20px; height: 20px; }
.hero-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hero-sub .handle { font-size: 0.875rem; }
.pill-muted { font: 500 0.75rem/1 var(--font-body); padding: 4px 7px; border-radius: 4px; background: var(--surface-2); color: var(--muted); }
.hero-bio { max-width: 60ch; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.875rem; color: var(--muted); }
.hero-meta span, .hero-meta a { display: inline-flex; align-items: center; gap: 5px; }
.hero-meta .ic { width: 16px; height: 16px; }
.hero-meta .site, .hero-meta a { color: var(--accent); }
.hero-meta a:hover { text-decoration: underline; }
.hero-counts { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 0.9375rem; color: var(--muted); }
.hero-counts strong { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; margin-right: 4px; display: inline-block; }
.bump { animation: bump .4s var(--ease-spring); }
@keyframes bump { 40% { transform: translateY(-3px) scale(1.12); color: var(--accent); } }
.known { display: flex; align-items: center; gap: 10px; font-size: 0.8125rem; color: var(--muted); }
.stack-av { display: flex; flex: none; }
.stack-av .av { --s: 24px; border: 2px solid var(--surface); font-size: 0.5625rem; }
.stack-av .av + .av { margin-left: -8px; }
.notice { display: flex; gap: 10px; align-items: flex-start; font-size: 0.875rem; color: var(--ink); background: var(--accent-soft); border-radius: 12px; padding: 10px 12px; }
.notice .ic { width: 18px; height: 18px; color: var(--accent); margin-top: 1px; }

/* Tabs */
.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.tab {
  position: relative; border: 0; background: none; padding: 15px 8px; color: var(--muted);
  font: 600 0.9375rem/1 var(--font-body); cursor: pointer; transition: background-color .15s ease, color .15s ease;
}
.tab:hover { background: var(--hover); color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab::after {
  content: ""; position: absolute; left: 50%; bottom: -1px; width: 52px; height: 3px; margin-left: -26px; border-radius: 3px;
  background: var(--accent); transform: scaleX(0); transition: transform .28s var(--ease-out);
}
.tab[aria-selected="true"]::after { transform: scaleX(1); }
.tab .n { font: 500 0.75rem/1 var(--font-mono); color: var(--muted); margin-left: 4px; }
.tabpanel { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

/* Rows (members, spaces) */
.rows { display: grid; }
.row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); transition: background-color .15s ease; }
.rows > .row:first-child { border-top: 0; }
a.row:hover { background: var(--hover); }
.row-info { min-width: 0; display: grid; gap: 1px; line-height: 1.3; }
.row-info strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.row-info span { font-size: 0.8125rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role { font: 500 0.6875rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; padding: 4px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); }
.rows-foot { padding: 14px 16px 18px; font-size: 0.8125rem; color: var(--muted); border-top: 1px solid var(--line); display: flex; gap: 8px; }
.rows-foot .ic { width: 15px; height: 15px; margin-top: 2px; }

/* About (space) */
.about { display: grid; gap: 0; }
.about-sec { padding: 18px 16px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.about-sec:first-child { border-top: 0; }
.about-sec h2 { font-size: 1.0625rem; font-weight: 800; }
.about-sec > p { color: var(--muted); max-width: 60ch; }
.rules { list-style: none; counter-reset: rule; margin: 0; padding: 0; display: grid; gap: 10px; }
.rules li { counter-increment: rule; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; }
.rules li::before { content: counter(rule); width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font: 600 0.8125rem var(--font-mono); color: var(--ink); }
.rules li span { padding-top: 3px; }
.layer-floor { display: grid; gap: 6px; }
.lf { border-radius: 10px; padding: 10px 12px; display: flex; justify-content: space-between; gap: 10px; font-size: 0.875rem; }
.lf strong { font-weight: 600; }
.lf span { color: var(--muted); }
.lf-space { border: 1px dashed var(--line); margin-left: 20px; }
.lf-net { background: var(--ink); color: var(--bg); }
.lf-net span { color: var(--bg); opacity: .75; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; font-size: 0.9375rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.locked { padding: 48px 24px 56px; display: grid; gap: 10px; justify-items: center; text-align: center; }
.locked .lock-ic { width: 56px; height: 56px; border-radius: 16px; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; }
.locked .lock-ic .ic { width: 26px; height: 26px; }
.locked strong { font: 800 1.125rem/1.2 var(--font-display); }
.locked p { color: var(--muted); max-width: 40ch; }
.join-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--hover); font-size: 0.9375rem; }

/* ---------- Notifications ---------- */
.head-actions { margin-left: auto; display: flex; gap: 2px; }
.page-head .tabs.in-head { border-bottom: 0; }
.group-label {
  padding: 18px 16px 8px; border-top: 1px solid var(--line);
  font: 500 0.75rem/1.2 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
}
.nlist > .group-label:first-child { border-top: 0; }
.notif {
  position: relative;
  display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px;
  padding: 14px 16px; border-top: 1px solid var(--line);
  transition: background-color .45s ease, transform .18s var(--ease-out);
}
.group-label + .notif { border-top: 0; }
.notif.is-link { cursor: pointer; }
.notif.is-link:hover { background: var(--hover); }
.notif.is-link:active:not(:has(button:active, a:active)) { transform: scale(.994); }
.notif.is-unread { background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); }
.notif.is-unread:hover { background: color-mix(in srgb, var(--accent-soft) 80%, var(--surface)); }
.notif.is-unread::after {
  content: ""; position: absolute; right: 16px; top: 20px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); animation: pulse-dot 2.4s ease-in-out infinite;
}
@keyframes pulse-dot { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }
.stagger > .notif { animation: rise .42s var(--ease-out) backwards; }
.stagger > .notif:nth-of-type(2) { animation-delay: .04s; }
.stagger > .notif:nth-of-type(3) { animation-delay: .08s; }
.stagger > .notif:nth-of-type(4) { animation-delay: .12s; }
.stagger > .notif:nth-of-type(n+5) { animation-delay: .16s; }
.notif-ic {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent);
}
.notif-ic .ic { width: 17px; height: 17px; }
.notif-ic use[href="#i-heart"] { fill: currentColor; }
.notif-main { min-width: 0; display: grid; gap: 8px; padding-right: 18px; }
.notif-avs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.av-more {
  height: 32px; min-width: 32px; padding: 0 8px; border-radius: 999px;
  display: grid; place-items: center; background: var(--surface-2); color: var(--muted);
  font: 600 0.75rem/1 var(--font-body);
}
.notif-text { font-size: 0.9375rem; line-height: 1.45; overflow-wrap: anywhere; }
.notif-text time, .notif-text .dot { color: var(--muted); }
.nl { font-weight: 600; color: var(--ink); }
.nl:hover { text-decoration: underline; }
.notif-quote { color: var(--muted); font-size: 0.9375rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-card { border: 1px solid var(--line); border-radius: 14px; padding: 4px 12px 2px; background: var(--surface); }
.notif-card .reply { padding-top: 8px; }
.notif-space { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: var(--surface); transition: border-color .15s ease; }
.notif-space:hover { border-color: var(--accent); }
.notif-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Settings switches */
.pref-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line); }
.rows > .pref-row:first-child { border-top: 0; }
.pref-row .row-info span { white-space: normal; }
.switch {
  position: relative; width: 46px; height: 28px; flex: none; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface-2); transition: background-color .2s ease, border-color .2s ease;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--muted); transition: transform .25s var(--ease-spring), background-color .2s ease;
}
.switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(18px); background: var(--accent-ink); }

/* ---------- Messages ---------- */
.shell.is-wide { grid-template-columns: 248px minmax(0, 940px); }
.dm {
  display: grid; grid-template-columns: 340px minmax(0, 1fr);
  height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
}
.dm-list, .dm-thread { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.dm-list { border-right: 1px solid var(--line); overflow-y: auto; }
.dm-thread { overflow: hidden; animation: fade .25s ease; }
.dm .page-head { top: 0; }
.dm-search { margin: 0 16px 12px; }
.dm-back { display: none; }
.conv {
  position: relative;
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 12px 16px; transition: background-color .15s ease;
}
.conv:hover { background: var(--hover); }
.conv[aria-current="true"] { background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface)); }
.conv[aria-current="true"]::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.conv-info { min-width: 0; display: grid; gap: 2px; line-height: 1.3; }
.conv-name { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 600; }
.conv-name > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-space { display: inline-flex; color: var(--muted); flex: none; }
.conv-space .ic { width: 14px; height: 14px; }
.conv-prev { font-size: 0.875rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv.is-unread .conv-name { font-weight: 800; }
.conv.is-unread .conv-prev { color: var(--ink); font-weight: 500; }
.conv-meta { display: grid; justify-items: end; gap: 4px; font-size: 0.75rem; color: var(--muted); }
.av-pair { position: relative; width: var(--s); height: var(--s); flex: none; display: inline-block; }
.av-pair .av { position: absolute; border: 2px solid var(--surface); }
.av-pair .av:first-child { left: 0; top: 0; }
.av-pair .av:last-child { right: 0; bottom: 0; }

.dm-head .head-row { gap: 10px; }
.dm-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 16px 12px; display: flex; flex-direction: column; }
.dm-msgs { display: flex; flex-direction: column; }
.dm-intro { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 20px 0 8px; }
.dm-intro strong { font: 800 1.125rem/1.2 var(--font-display); margin-top: 6px; }
.dm-rel { font-size: 0.8125rem; color: var(--muted); }
.dm-note { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); font-size: 0.75rem; color: var(--muted); }
.dm-note .ic { width: 13px; height: 13px; }
.dm-day { display: flex; justify-content: center; margin: 18px 0 6px; }
.dm-day span { font-size: 0.75rem; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 4px 10px; }
.msg { display: flex; align-items: flex-end; gap: 8px; margin-top: 2px; max-width: 100%; }
.msg.first { margin-top: 10px; }
.msg.mine { flex-direction: row-reverse; }
.msg-av { width: 28px; flex: none; display: inline-flex; }
.msg-col { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; max-width: min(78%, 460px); }
.msg.mine .msg-col { align-items: flex-end; }
.msg-name { font-size: 0.75rem; color: var(--muted); padding-left: 12px; }
.bubble {
  padding: 9px 13px; border-radius: 18px; background: var(--surface-2); color: var(--ink);
  font-size: 0.9375rem; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text;
}
.msg.mine .bubble { background: var(--accent); color: var(--accent-ink); }
.msg.mine .bubble .mention, .msg.mine .bubble .hashtag { color: inherit; text-decoration: underline; }
.msg:not(.mine):not(.first) .bubble { border-top-left-radius: 6px; }
.msg:not(.mine):not(.last) .bubble { border-bottom-left-radius: 6px; }
.msg.mine:not(.first) .bubble { border-top-right-radius: 6px; }
.msg.mine:not(.last) .bubble { border-bottom-right-radius: 6px; }
.msg-time { font-size: 0.6875rem; color: var(--muted); padding: 0 6px; }
.msg-img { display: block; max-width: min(260px, 100%); border-radius: 16px; border: 1px solid var(--line); }
.msg.is-new { animation: msg-in .34s var(--ease-spring); transform-origin: bottom left; }
.msg.mine.is-new { transform-origin: bottom right; }
@keyframes msg-in { from { opacity: 0; transform: translateY(10px) scale(.94); } }
.dm-seen { align-self: flex-end; font-size: 0.6875rem; color: var(--muted); padding: 2px 6px 0; animation: fade .3s ease; }
.typing { animation: msg-in .3s var(--ease-spring); }
.typing-b { display: flex; gap: 4px; padding: 13px 14px; }
.typing-b i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s ease-in-out infinite; }
.typing-b i:nth-child(2) { animation-delay: .15s; }
.typing-b i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }
.shared {
  display: grid; gap: 4px; max-width: min(320px, 100%); text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; background: var(--surface); color: var(--ink);
  transition: border-color .15s ease, transform .15s ease;
}
.shared:hover { border-color: var(--accent); }
.shared:active { transform: scale(.98); }
.shared-head { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 0.8125rem; }
.shared-head .av { --s: 20px; font-size: 0.5rem; }
.shared-head .handle { font-size: 0.75rem; }
.shared-body { font-size: 0.875rem; line-height: 1.4; }
.shared-poll { display: inline-flex; align-items: center; gap: 5px; font-size: 0.75rem; color: var(--accent); font-weight: 600; }
.shared-poll .ic { width: 14px; height: 14px; }
.dm-compose { border-top: 1px solid var(--line); padding: 10px 12px; display: grid; gap: 8px; background: var(--surface); }
.dm-row { display: flex; align-items: flex-end; gap: 2px; }
.dm-row .tool { flex: none; }
.dm-row textarea {
  flex: 1; min-width: 0; margin: 0 4px; resize: none; field-sizing: content; min-height: 40px; max-height: 140px;
  border: 1px solid var(--line); border-radius: 20px; padding: 9px 14px; background: var(--bg); color: var(--ink);
  font: 0.9375rem/1.4 var(--font-body); transition: border-color .15s ease;
}
.dm-row textarea:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dm-send {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); display: grid; place-items: center;
  transition: transform .2s var(--ease-spring), opacity .15s ease;
}
.dm-send .ic { width: 18px; height: 18px; margin-left: -2px; }
.dm-send:disabled { opacity: .35; cursor: not-allowed; }
.dm-send:not(:disabled):active { transform: scale(.88) rotate(-12deg); }
.dm-attach { display: flex; }
.dm-thumb { width: 96px; }
.dm-emoji .emoji-grid { max-height: 150px; }
.dm-req { border-top: 1px solid var(--line); padding: 14px 16px; display: grid; gap: 12px; background: var(--hover); font-size: 0.9375rem; }
.dm-req p { color: var(--muted); }
.dm-req strong { color: var(--ink); }
.dm-empty { flex: 1; align-content: center; }
.dm-empty .btn { margin-top: 8px; }
.dm-new-search { padding: 12px 16px 6px; }
.row-btn { width: 100%; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.row-btn:hover { background: var(--hover); }
.rows > .row-btn:first-child { border-top: 0; }
.dm-info-actions { padding: 14px 16px 18px; justify-content: flex-start; border-top: 1px solid var(--line); }
@media (max-width: 1179px) { .shell.is-wide { grid-template-columns: 76px minmax(0, 940px); } }
@media (max-width: 999px) {
  .dm { grid-template-columns: minmax(0, 1fr); }
  .dm:not(.show-thread) .dm-thread { display: none; }
  .dm.show-thread .dm-list { display: none; }
  .dm.show-thread .dm-thread { animation: slide-in .3s var(--ease-out); }
  .dm-list { border-right: 0; }
  .dm-back { display: grid; }
}
@keyframes slide-in { from { opacity: .4; transform: translateX(28px); } }
@media (max-width: 699px) {
  .shell.is-wide { grid-template-columns: minmax(0, 1fr); }
  .shell.is-wide .main { padding-bottom: 0; }
  .dm-list { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .msg-col { max-width: 80%; }
}

/* ---------- Live mode ---------- */
.skel-wrap { display: grid; }
.skel { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 16px; border-top: 1px solid var(--line); }
.skel-wrap > .skel:first-child { border-top: 0; }
.skel-av { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); }
.skel-lines { display: grid; gap: 9px; padding-top: 4px; }
.skel-lines i { display: block; height: 11px; border-radius: 6px; background: var(--surface-2); }
.skel-lines i:first-child { width: 40%; }
.skel-lines i.short { width: 60%; }
.skel-av, .skel-lines i {
  background-image: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent);
  background-size: 200% 100%; background-repeat: no-repeat;
  animation: shimmer 1.3s ease-in-out infinite;
}
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }
.load-more { min-height: 1px; }
.load-btn { display: block; margin: 16px auto 28px; }
.signin-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 12px 16px 4px; padding: 12px 14px;
  border-radius: 14px; background: var(--accent-soft); color: var(--ink); font-size: 0.9375rem;
}
.signin-banner > .ic { color: var(--accent); }
.signin-banner span { flex: 1; min-width: 200px; }
.live-error .ic, .unavailable .ic { width: 28px; height: 28px; }
.live-error .btn, .unavailable .btn { margin-top: 8px; }
.unavailable { padding-block: 64px; }
.unavailable span { max-width: 42ch; }
.edited { flex: none; margin-left: 6px; font-size: 0.75rem; color: var(--muted); font-style: italic; }
.mod-row { color: var(--gold); }
.mod-row span { color: var(--gold); font-weight: 600; }
.anc-more { font-size: 0.8125rem; color: var(--muted); padding: 2px 0 8px 60px; }
.quote-card {
  display: grid; gap: 4px; width: 100%; margin: 6px 0 2px; padding: 10px 12px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); font: inherit;
  transition: border-color .15s ease;
}
.quote-card:hover { border-color: var(--accent); }
.quote-card .q-head { display: flex; align-items: baseline; gap: 6px; min-width: 0; font-size: 0.875rem; }
.quote-card .q-head .handle { font-size: 0.75rem; }
.quote-card .q-body { font-size: 0.9375rem; line-height: 1.45; overflow-wrap: anywhere; }
.quote-card.is-gone { cursor: default; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.875rem; }
.quote-card.is-gone .ic { width: 16px; height: 16px; }
.live-link { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; color: var(--ink); transition: border-color .15s ease; }
.live-link:hover { border-color: var(--accent); }
.live-link .lc-text { display: grid; gap: 2px; min-width: 0; }
.live-link .lc-img { width: 72px; height: 72px; border-radius: 10px; overflow: hidden; background: var(--surface-2); flex: none; }
.live-link .lc-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.live-link:not(:has(.lc-img)) { grid-template-columns: minmax(0, 1fr); }
img[data-img-token]:not([src]) { background: var(--surface-2); min-height: 80px; }
img.img-failed { opacity: .4; }
.about-sec .notice { margin: 0; }
.about-sec .notif-actions { margin-top: 2px; }
.hint { font-size: 0.8125rem; color: var(--muted); }
.about-sec .hint { padding: 0 2px; }
.apw-list { border: 1px solid var(--line); border-radius: 12px; }
.facts code, .row-info code { font-family: var(--font-mono); font-size: 0.8125rem; overflow-wrap: anywhere; }
.code-box { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.code-box code { flex: 1; min-width: 0; font: 500 0.9375rem/1.4 var(--font-mono); letter-spacing: .04em; overflow-wrap: anywhere; }
.field-inline { display: flex; flex-wrap: wrap; gap: 10px; }
.field-inline input {
  flex: 1; min-width: 160px; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: 999px; padding: 10px 14px; font: 1rem/1.3 var(--font-body);
}
.field-inline input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.codes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.codes code { display: block; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); font: 500 0.875rem var(--font-mono); text-align: center; }
.rail-note { padding: 0 16px 8px; font-size: 0.875rem; color: var(--muted); }
.status-line { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.status-dot.online { background: var(--repost); box-shadow: 0 0 0 3px color-mix(in srgb, var(--repost) 25%, transparent); }
.status-dot.offline { background: var(--danger); }
.status-dot.checking { animation: blink 1.2s ease-in-out infinite; }
.pill-muted .ic { width: 12px; height: 12px; vertical-align: -1px; margin-right: 3px; }

/* ---------- Sheet (dialog) ---------- */
.sheet {
  --from: translateY(16px) scale(.97);
  border: 0; padding: 0; margin: auto;
  width: min(600px, calc(100vw - 32px));
  max-height: min(88dvh, 900px);
  background: var(--surface); color: var(--ink);
  border-radius: 20px;
  box-shadow: 0 30px 80px -30px var(--shadow);
  overflow: hidden;
  display: none;
}
.sheet[open] { display: flex; flex-direction: column; animation: sheet-in .32s var(--ease-out); }
.sheet::backdrop { background: var(--scrim); }
.sheet[open]::backdrop { animation: fade-bg .32s ease; }
.sheet.closing { animation: sheet-out .2s ease forwards; }
.sheet.closing::backdrop { animation: fade-bg-out .2s ease forwards; }
@keyframes sheet-in { from { opacity: 0; transform: var(--from); } }
@keyframes sheet-out { to { opacity: 0; transform: var(--from); } }
@keyframes fade-bg { from { opacity: 0; } }
@keyframes fade-bg-out { to { opacity: 0; } }
.sheet-grab { display: none; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); flex: none; }
.sheet-head h2 { font-size: 1.125rem; font-weight: 800; margin-right: auto; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.sheet-body .rows > .row:first-child { border-top: 0; }
.sheet-sec { padding: 14px 16px 4px; font: 500 0.75rem/1.2 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.confirm { padding: 18px 16px 20px; display: grid; gap: 16px; }
.confirm p { color: var(--muted); }
.confirm-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  max-width: calc(100vw - 32px); width: max-content;
  background: var(--ink); color: var(--bg); border-radius: 12px; padding: 11px 16px;
  font: 500 0.875rem/1.4 var(--font-body); box-shadow: 0 14px 34px -12px var(--shadow);
  transform: translate(-50%, 0); overflow-wrap: anywhere;
  animation: toast-in .3s var(--ease-spring);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 16px) scale(.96); } }

/* Scene windmills */
.blades { transform-box: view-box; animation: spin 14s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 1179px) {
  .shell { grid-template-columns: 76px minmax(0, 620px) 300px; column-gap: 20px; }
  .sidebar { align-items: center; }
  .sidebar .label, .sidebar .nbadge-label { display: none; }
  .side-brand { padding: 8px 0 18px; }
  .nav-item { width: 52px; height: 52px; padding: 0; justify-content: center; }
  .nav-item .nbadge { position: absolute; top: 6px; right: 4px; margin: 0; min-width: 18px; height: 18px; line-height: 18px; font-size: 0.6875rem; padding: 0 5px; }
  .side-post { width: 52px; height: 52px; padding: 0; }
  .me-card { padding: 6px; }
}
@media (max-width: 999px) {
  .shell { grid-template-columns: 76px minmax(0, 640px); }
  .rail { display: none; }
}
@media (max-width: 699px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding-inline: 0; column-gap: 0; }
  .sidebar { display: none; }
  .main { border-inline: 0; padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .bottombar { display: grid; }
  .fab { display: grid; }
  body.dm-open .bottombar, body.dm-open .fab { display: none; }
  .page-head .head-me { display: inline-flex; }
  .page-head .head-logo { display: inline-flex; }
  .page-head .head-desktop { display: none; }
  .composer.inline { display: none; }
  .new-pill { top: calc(env(safe-area-inset-top, 0px) + 108px); }
  .post { padding-inline: 14px; }
  .hero-av { --s: 88px !important; font-size: 1.8rem; }
  .hero-top { margin-top: -44px; }
  .toggle-btn { min-width: 96px; padding: 0 14px; }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
  .sheet {
    --from: translateY(100%);
    width: 100%; max-width: 100%; margin: auto 0 0;
    max-height: 92dvh; border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .sheet[open] { animation-duration: .38s; }
  .sheet-grab { display: block; }
  .actions { max-width: none; }
}
@media (max-width: 380px) {
  .act { padding-inline: 6px; }
  .hero-actions .round-btn:first-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero-img svg { transform: none; }
}

/* ---------- Avatar and header images, signed-in avatar ---------- */
.me-av { display: contents; }
.av { overflow: hidden; }
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
a.toggle-btn { display: inline-flex; align-items: center; justify-content: center; }
