/* Astyne Connect */

/* ── Tokens ─────────────────────────────────────────────────────────────────────────────── */

:root {
  color-scheme: light;
  --bg: #f6f6f8;
  --surface: #ffffff;
  --surface-2: #f9f9fb;
  --sidebar: #fbfbfc;
  --ink: #0b0c0f;
  --ink-2: #33343a;
  --muted: #6c6d75;
  --faint: #9a9ba3;
  --line: #e7e7ec;
  --line-strong: #d7d7de;
  --hover: rgba(16, 17, 22, 0.045);
  --active: rgba(16, 17, 22, 0.075);
  --accent: #0d6bff;
  --accent-soft: rgba(13, 107, 255, 0.08);
  --accent-ring: rgba(13, 107, 255, 0.22);
  --danger: #d92d20;
  --success: #12805c;
  --like: #e0245e;
  --aether: #a8741a;
  --aether-soft: rgba(201, 150, 52, 0.12);
  --outpost: #2f755c;
  --outpost-soft: rgba(47, 117, 92, 0.1);
  --astyne: #0d6bff;
  --astyne-soft: rgba(13, 107, 255, 0.08);
  --shadow-sm: 0 1px 2px rgba(16, 17, 22, 0.04), 0 2px 8px rgba(16, 17, 22, 0.04);
  --shadow-md: 0 8px 24px rgba(16, 17, 22, 0.08), 0 2px 6px rgba(16, 17, 22, 0.04);
  --shadow-lg: 0 24px 64px rgba(16, 17, 22, 0.18), 0 4px 14px rgba(16, 17, 22, 0.06);
  --radius: 18px;
  --st-neutral-bg: rgba(16, 17, 22, 0.06); --st-neutral: #3f4047;
  --st-amber-bg: #fff3dc; --st-amber: #8f5300;
  --st-blue-bg: #e6efff; --st-blue: #0b57d0;
  --st-violet-bg: #f0e9ff; --st-violet: #6536c9;
  --st-green-bg: #e2f5ec; --st-green: #0d7248;
  --st-muted-bg: rgba(16, 17, 22, 0.05); --st-muted: #7a7b83;
  --st-red-bg: #fde7e6; --st-red: #b42318;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #09090b;
    --surface: #131316;
    --surface-2: #1a1a1e;
    --sidebar: #0e0e11;
    --ink: #f4f4f6;
    --ink-2: #d2d2d8;
    --muted: #9a9aa4;
    --faint: #6d6d77;
    --line: #24242a;
    --line-strong: #33333b;
    --hover: rgba(255, 255, 255, 0.055);
    --active: rgba(255, 255, 255, 0.09);
    --accent: #4f8fff;
    --accent-soft: rgba(79, 143, 255, 0.13);
    --accent-ring: rgba(79, 143, 255, 0.32);
    --danger: #ff6b5e;
    --success: #3fcf8e;
    --like: #ff4f8b;
    --aether: #e3b457;
    --aether-soft: rgba(227, 180, 87, 0.13);
    --outpost: #5cc49c;
    --outpost-soft: rgba(92, 196, 156, 0.12);
    --astyne: #4f8fff;
    --astyne-soft: rgba(79, 143, 255, 0.12);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
    --st-neutral-bg: rgba(255, 255, 255, 0.08); --st-neutral: #d2d2d8;
    --st-amber-bg: rgba(255, 179, 64, 0.14); --st-amber: #ffc36b;
    --st-blue-bg: rgba(79, 143, 255, 0.16); --st-blue: #8db6ff;
    --st-violet-bg: rgba(160, 120, 255, 0.16); --st-violet: #c3a8ff;
    --st-green-bg: rgba(63, 207, 142, 0.14); --st-green: #6fe0ad;
    --st-muted-bg: rgba(255, 255, 255, 0.06); --st-muted: #9a9aa4;
    --st-red-bg: rgba(255, 107, 94, 0.15); --st-red: #ff9a90;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #09090b;
  --surface: #131316;
  --surface-2: #1a1a1e;
  --sidebar: #0e0e11;
  --ink: #f4f4f6;
  --ink-2: #d2d2d8;
  --muted: #9a9aa4;
  --faint: #6d6d77;
  --line: #24242a;
  --line-strong: #33333b;
  --hover: rgba(255, 255, 255, 0.055);
  --active: rgba(255, 255, 255, 0.09);
  --accent: #4f8fff;
  --accent-soft: rgba(79, 143, 255, 0.13);
  --accent-ring: rgba(79, 143, 255, 0.32);
  --danger: #ff6b5e;
  --success: #3fcf8e;
  --like: #ff4f8b;
  --aether: #e3b457;
  --aether-soft: rgba(227, 180, 87, 0.13);
  --outpost: #5cc49c;
  --outpost-soft: rgba(92, 196, 156, 0.12);
  --astyne: #4f8fff;
  --astyne-soft: rgba(79, 143, 255, 0.12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --st-neutral-bg: rgba(255, 255, 255, 0.08); --st-neutral: #d2d2d8;
  --st-amber-bg: rgba(255, 179, 64, 0.14); --st-amber: #ffc36b;
  --st-blue-bg: rgba(79, 143, 255, 0.16); --st-blue: #8db6ff;
  --st-violet-bg: rgba(160, 120, 255, 0.16); --st-violet: #c3a8ff;
  --st-green-bg: rgba(63, 207, 142, 0.14); --st-green: #6fe0ad;
  --st-muted-bg: rgba(255, 255, 255, 0.06); --st-muted: #9a9aa4;
  --st-red-bg: rgba(255, 107, 94, 0.15); --st-red: #ff9a90;
}

.space-aether { --space-accent: var(--aether); --space-soft: var(--aether-soft); }
.space-outpost-go { --space-accent: var(--outpost); --space-soft: var(--outpost-soft); }
.space-astyne { --space-accent: var(--astyne); --space-soft: var(--astyne-soft); }

/* ── Base ───────────────────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11';
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
img, video, svg { display: block; max-width: 100%; }
.icon { flex-shrink: 0; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-ring); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.bad { color: var(--danger); }
body.modal-open, body.nav-open { overflow: hidden; }
[hidden] { display: none !important; }

.wm { width: auto; }
.wm-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .wm-dark { display: none; }
  :root:not([data-theme="light"]) .wm-light { display: block; }
}
:root[data-theme="dark"] .wm-dark { display: none; }
:root[data-theme="dark"] .wm-light { display: block; }

/* ── Shell ──────────────────────────────────────────────────────────────────────────────── */

.app { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }

.sidebar {
  position: sticky; top: 0;
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  z-index: 60;
}
.sb-top { padding: 18px 16px 8px; }
.sb-brand { display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 8px; border-radius: 12px; }
.sb-brand .wm { height: 21px; }
.brand-tag, .sb-brand-tag, .auth-brand-tag {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em;
  padding: 3px 8px; border-radius: 999px;
  background: var(--active); color: var(--ink-2);
}
.sb-nav { flex: 1; overflow-y: auto; padding: 6px 12px 18px; scrollbar-width: thin; }
.sb-link, .sb-space-head, .sb-ch {
  display: flex; align-items: center; gap: 11px;
  border-radius: 10px; color: var(--ink-2); font-weight: 500;
  transition: background 0.12s, color 0.12s;
}
.sb-link { height: 42px; padding: 0 12px; font-size: 15px; }
.sb-link:hover, .sb-ch:hover, .sb-space-head:hover { background: var(--hover); color: var(--ink); }
.sb-link.on, .sb-ch.on, .sb-space-head.on { background: var(--active); color: var(--ink); font-weight: 650; }
.sb-label { margin: 20px 12px 8px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint); }
.sb-space { margin-bottom: 8px; }
.sb-space-head { height: 38px; padding: 0 10px 0 9px; font-weight: 650; color: var(--ink); }
.sb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--space-accent); margin-left: auto; }
.sb-channels { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 0 20px; padding-left: 10px; border-left: 1px solid var(--line); }
.sb-ch { height: 32px; padding: 0 10px; font-size: 14px; color: var(--muted); }
.sb-ch .icon { opacity: 0.85; }
.sb-ch.on .icon { color: var(--space-accent); opacity: 1; }
.sb-user { padding: 12px; border-top: 1px solid var(--line); }
.sb-auth { display: flex; flex-direction: column; gap: 6px; }
.sb-me { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 14px; text-align: left; color: var(--muted); }
.sb-me:hover { background: var(--hover); }
.sb-me-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.sb-me-text b { color: var(--ink); font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-me-text span { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.page { min-width: 0; }
.topbar { display: none; }
.scrim { display: none; }
#banner:empty { display: none; }
#banner { max-width: 1016px; margin: 0 auto; padding: 14px 28px 0; }
.banner {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 16px; border-radius: 14px;
  background: var(--accent-soft); color: var(--ink); font-size: 14px; font-weight: 500;
}
.banner > span { flex: 1; }
.banner a { text-decoration: underline; }
.banner-bad { background: var(--st-red-bg); }

.columns { display: grid; grid-template-columns: minmax(0, 640px) 320px; gap: 32px; justify-content: center; padding: 0 28px 96px; }
.main { min-width: 0; outline: none; }
.rail {
  position: sticky; top: 0; align-self: start;
  max-height: 100vh; max-height: 100dvh; overflow-y: auto; scrollbar-width: none;
  display: flex; flex-direction: column; gap: 14px;
  padding: 20px 0 28px;
}
.rail::-webkit-scrollbar { display: none; }

.fab {
  display: none; position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 45; width: 58px; height: 58px; border-radius: 50%;
  place-items: center; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg);
  transition: transform 0.15s;
}
.fab:active { transform: scale(0.94); }

/* ── Buttons & controls ─────────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px;
  font-weight: 650; font-size: 14.5px; letter-spacing: -0.005em; white-space: nowrap;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s, box-shadow 0.15s, opacity 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { opacity: 0.88; }
.btn-outline { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover { background: var(--surface-2); border-color: var(--faint); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { background: var(--hover); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; }
.btn-danger-outline { border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); background: transparent; }
.btn-danger-outline:hover { background: color-mix(in srgb, var(--danger) 8%, transparent); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15.5px; }
.btn-block { width: 100%; }
.btn-google { gap: 10px; }

.icon-btn {
  width: 36px; height: 36px; flex-shrink: 0;
  display: inline-grid; place-items: center; border-radius: 999px; color: var(--muted);
  transition: background 0.12s, color 0.12s;
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn.on { color: var(--accent); background: var(--accent-soft); }
label.icon-btn { cursor: pointer; }
.link-btn { color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.link-btn:hover { text-decoration: underline; }

.input {
  width: 100%; height: 44px; padding: 0 14px;
  border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.input { height: auto; padding: 10px 14px; resize: vertical; min-height: 68px; line-height: 1.5; }
.input:focus, .dob select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.input::placeholder, textarea::placeholder { color: var(--faint); }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; min-width: 0; }
.field-label { font-size: 13.5px; font-weight: 650; color: var(--ink-2); }
.field-label-row { display: flex; justify-content: space-between; align-items: center; }
.field-label-row .link-btn { font-size: 13px; }
.optional { font-weight: 500; color: var(--faint); margin-left: 4px; }
.hint { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; line-height: 1.45; }
.hint a { text-decoration: underline; }
.hint.good { color: var(--success); }
.hint.bad { color: var(--danger); }
.form-error { color: var(--danger); font-size: 13.5px; line-height: 1.45; }
.form-error:empty { display: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 1px; flex-shrink: 0; accent-color: var(--ink); cursor: pointer; }
.check a { color: var(--ink); text-decoration: underline; }

.dob { display: grid; grid-template-columns: 1.5fr 0.8fr 1fr; gap: 8px; }
.dob select {
  appearance: none; -webkit-appearance: none;
  height: 46px; padding: 0 30px 0 12px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239a9ba3' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
  color: var(--ink); cursor: pointer; font-size: 15px;
}

.switch {
  appearance: none; -webkit-appearance: none;
  width: 44px; height: 26px; border-radius: 999px; flex-shrink: 0;
  background: var(--line-strong); position: relative; cursor: pointer; transition: background 0.2s;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.switch:checked { background: var(--success); }
.switch:checked::after { transform: translateX(18px); }

.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--hover); align-self: flex-start; }
.segmented button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ── Avatars, marks, badges, pills ──────────────────────────────────────────────────────── */

.avatar {
  --av-size: 40px;
  width: var(--av-size); height: var(--av-size); flex-shrink: 0;
  display: inline-grid; place-items: center; border-radius: 50%;
  color: #fff; font-weight: 700; font-size: calc(var(--av-size) * 0.38); letter-spacing: 0.01em;
  background: linear-gradient(140deg, hsl(var(--av-h) 74% 62%), hsl(calc(var(--av-h) + 38) 68% 44%));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  user-select: none; -webkit-user-select: none;
}
.avatar.is-team { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--accent); }
.avatar-ghost { background: var(--active); color: var(--muted); }

.space-mark {
  width: var(--sm-size); height: var(--sm-size); flex-shrink: 0;
  display: inline-grid; place-items: center; overflow: hidden;
  border-radius: 28%; background: #000;
}
.space-mark img { width: 100%; height: 100%; object-fit: cover; }
.space-mark.space-astyne { background: #fff; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
/* The Outpost Go signpost is drawn in light grey; as a white silhouette on Outpost green it reads at any size. */
.space-mark.space-outpost-go { background: #2f755c; }
.space-mark.space-outpost-go img { filter: brightness(0) invert(1); padding: 9%; }

.team-badge { display: inline-flex; align-items: center; gap: 3px; color: var(--accent); font-size: 12px; font-weight: 700; flex-shrink: 0; }
.team-badge .icon { --badge-check: var(--surface); }

.status {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 650; letter-spacing: 0.005em; white-space: nowrap;
}
.status-neutral { background: var(--st-neutral-bg); color: var(--st-neutral); }
.status-amber { background: var(--st-amber-bg); color: var(--st-amber); }
.status-blue { background: var(--st-blue-bg); color: var(--st-blue); }
.status-violet { background: var(--st-violet-bg); color: var(--st-violet); }
.status-green { background: var(--st-green-bg); color: var(--st-green); }
.status-muted { background: var(--st-muted-bg); color: var(--st-muted); }
.status-red { background: var(--st-red-bg); color: var(--st-red); }
.flag-pill {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px;
  background: var(--hover); color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.ok-pill { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 650; color: var(--success); background: color-mix(in srgb, var(--success) 12%, transparent); padding: 2px 8px; border-radius: 999px; }

/* ── Page heads, tabs, sections ─────────────────────────────────────────────────────────── */

.page-head {
  position: sticky; top: 0; z-index: 20;
  margin: 0 -10px 14px; padding: 18px 10px 0;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
}
.page-head:not(:has(.tabs)) { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.page-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.page-head h1 { font-size: 23px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.2; }
.page-desc { color: var(--muted); font-size: 14.5px; margin-top: 4px; line-height: 1.5; }
.page-head.compact { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; }
.page-head.compact h1 { font-size: 18px; }
.page-head-title { display: flex; flex-direction: column; line-height: 1.25; }
.page-head-title a:hover { text-decoration: underline; }
.crumb { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 650; color: var(--muted); margin-bottom: 4px; }
.crumb:hover { color: var(--ink); }
.channel-title { display: flex; align-items: center; gap: 8px; }
.channel-title .hash { color: var(--faint); display: inline-flex; }
.team-note { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 8px; }
.tabs { display: flex; gap: 2px; margin-top: 12px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; padding: 10px 12px 13px; color: var(--muted); font-weight: 650; font-size: 14.5px; white-space: nowrap; transition: color 0.12s; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); }
.tab.on::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--ink); }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 750; letter-spacing: -0.01em; margin: 24px 4px 12px; }
.section-title .count { color: var(--muted); font-weight: 600; }

/* ── Cards & posts ──────────────────────────────────────────────────────────────────────── */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.post { position: relative; padding: 18px 20px; margin-bottom: 12px; transition: border-color 0.15s, box-shadow 0.2s; }
.post[data-href] { cursor: pointer; }
.post[data-href]:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.post.is-full { cursor: default; }
.post-more { margin: -8px -10px -8px auto; }

.byline { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 14.5px; }
.byline .author-link { min-width: 0; overflow: hidden; }
.byline .name { font-weight: 650; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.byline .author-link:hover .name { text-decoration: underline; }
.byline .handle, .byline .dot, .byline .time { color: var(--muted); white-space: nowrap; }
.byline .handle { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.byline .time:hover { text-decoration: underline; }
.edited { font-size: 12px; color: var(--faint); }

.post-where { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; color: var(--ink-2); white-space: nowrap; }
.post-where:hover span:first-of-type { text-decoration: underline; }
.post-where-ch { color: var(--muted); font-weight: 500; }

.post-actions { display: flex; align-items: center; gap: 2px; margin-top: 10px; margin-left: -10px; }
.act {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; min-width: 34px; padding: 0 10px; border-radius: 999px;
  color: var(--muted); font-size: 13.5px; font-weight: 550; font-variant-numeric: tabular-nums;
  transition: background 0.12s, color 0.12s;
}
.act:hover { background: var(--hover); color: var(--ink); }
.act-like:hover { color: var(--like); background: color-mix(in srgb, var(--like) 9%, transparent); }
.act-like.on { color: var(--like); }
.act-like.on .icon { fill: currentColor; animation: pop 0.35s cubic-bezier(0.2, 0.8, 0.2, 1.4); }
@keyframes pop { 0% { transform: scale(0.7); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* Discussion: tweet-shaped */
.post-discussion { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; }
.post-main { min-width: 0; }
.post-head { display: flex; align-items: center; gap: 6px; min-height: 22px; }
.post-sub { display: flex; align-items: center; gap: 8px; margin-top: 2px; flex-wrap: wrap; }
.post-discussion .post-title { font-size: 16.5px; font-weight: 700; margin-top: 6px; letter-spacing: -0.01em; line-height: 1.35; }
.post-discussion h1.post-title { font-size: 22px; }
.post-discussion .prose { margin-top: 4px; }

/* Update: journal-shaped */
.post-update { padding: 20px 22px 16px; }
.post-eyebrow { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); font-weight: 550; flex-wrap: wrap; min-height: 22px; }
.eyebrow-space { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-weight: 650; }
.eyebrow-space:hover span { text-decoration: underline; }
.eyebrow-sep { color: var(--faint); }
.eyebrow-ch { color: var(--space-accent); font-weight: 650; }
.eyebrow-ch:hover { text-decoration: underline; }
.eyebrow-date::before { content: '·'; margin-right: 7px; color: var(--faint); }
.post-update .post-title { font-size: 22px; line-height: 1.22; letter-spacing: -0.025em; font-weight: 750; margin: 12px 0 2px; text-wrap: balance; }
.post-update.is-full .post-title { font-size: 30px; letter-spacing: -0.03em; margin-top: 14px; }
.post-update .prose { margin-top: 10px; }
.post-foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.post-foot .author-link { display: inline-flex; align-items: center; gap: 9px; font-weight: 650; font-size: 14px; min-width: 0; }
.post-foot .author-link .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-foot .author-link:hover .name { text-decoration: underline; }
.post-foot .post-actions { margin: 0 -8px 0 auto; }

/* Idea: vote-first */
.post-idea { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 16px; padding: 16px 18px 14px; }
.vote-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  width: 54px; height: 62px; border-radius: 14px;
  border: 1px solid var(--line-strong); background: var(--surface-2);
  color: var(--ink-2); font-weight: 750; font-size: 15px; font-variant-numeric: tabular-nums;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.vote-btn .icon { stroke-width: 2.4; }
.vote-btn:hover { border-color: var(--space-accent, var(--accent)); color: var(--space-accent, var(--accent)); }
.vote-btn:active { transform: scale(0.95); }
.vote-btn.on { background: var(--space-accent, var(--accent)); border-color: var(--space-accent, var(--accent)); color: #fff; }
.vote-btn.on .icon { animation: pop 0.35s cubic-bezier(0.2, 0.8, 0.2, 1.4); }
.idea-main { min-width: 0; }
.idea-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 24px; }
.post-idea .post-title { font-size: 17px; font-weight: 700; line-height: 1.35; letter-spacing: -0.012em; margin: 6px 0 2px; }
.post-idea h1.post-title { font-size: 24px; letter-spacing: -0.02em; margin-top: 10px; }
.post-idea .post-title a:hover { text-decoration: underline; }
.idea-excerpt { color: var(--muted); font-size: 14.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-idea .prose { margin-top: 8px; }
.idea-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--muted); min-width: 0; }
.idea-foot .byline { font-size: 13px; }
.idea-comments { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.post-idea .post-actions { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }

/* Rich text */
.prose { color: var(--ink-2); font-size: 15.5px; line-height: 1.62; overflow-wrap: anywhere; }
.prose > * + * { margin-top: 0.75em; }
.prose h3 { font-size: 18px; line-height: 1.3; color: var(--ink); font-weight: 750; letter-spacing: -0.015em; margin-top: 1.3em; }
.prose ul { list-style: disc; padding-left: 1.3em; }
.prose ol { list-style: decimal; padding-left: 1.4em; }
.prose li + li { margin-top: 0.3em; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.prose strong { color: var(--ink); font-weight: 650; }
.prose code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.87em; background: var(--hover); padding: 0.12em 0.38em; border-radius: 6px; }
.prose blockquote { border-left: 3px solid var(--line-strong); padding-left: 14px; color: var(--muted); }
.is-full .prose { font-size: 16.5px; line-height: 1.68; }
.read-more { display: inline-flex; align-items: center; gap: 3px; margin-top: 10px; font-weight: 650; font-size: 14px; color: var(--ink); }
.read-more:hover { text-decoration: underline; }

/* Media */
.media { margin-top: 14px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--line); }
.media-item { display: block; width: 100%; background: var(--surface-2); overflow: hidden; border: 0; padding: 0; cursor: zoom-in; }
.media-one .media-item { max-height: 560px; }
.media-item img, .media-item video { width: 100%; height: 100%; object-fit: cover; }
.media-item video { cursor: auto; background: #000; object-fit: contain; }
.media-item:hover img { transform: scale(1.01); }
.media-item img { transition: transform 0.4s; }

/* Polls */
.poll { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.poll-option {
  height: 46px; padding: 0 16px; border-radius: 12px; text-align: left;
  border: 1.5px solid color-mix(in srgb, var(--space-accent, var(--accent)) 55%, transparent);
  color: var(--ink); font-weight: 650; font-size: 15px;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.poll-option:hover { background: var(--space-soft, var(--accent-soft)); border-color: var(--space-accent, var(--accent)); }
.poll-option:active { transform: scale(0.99); }
.poll-row {
  position: relative; height: 46px; padding: 0 14px; border-radius: 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface-2); font-weight: 550; font-size: 15px;
}
.poll-fill { position: absolute; inset: 0 auto 0 0; background: var(--active); border-radius: 12px; transition: width 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
.poll-row.lead .poll-fill { background: color-mix(in srgb, var(--space-accent, var(--accent)) 24%, transparent); }
.poll-row.lead { font-weight: 700; }
.poll-label, .poll-pct { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.poll-pct { font-variant-numeric: tabular-nums; }
.poll-row.mine .poll-label .icon { color: var(--space-accent, var(--accent)); stroke-width: 2.6; }
.poll-meta { font-size: 13px; color: var(--muted); margin-top: 2px; padding-left: 2px; }

/* ── Home hero, composer prompt, space hero ─────────────────────────────────────────────── */

.hero-card {
  position: relative; overflow: hidden; margin: 6px 0 16px; padding: 30px 28px 22px;
  border-radius: 24px; border: 1px solid var(--line);
  background:
    radial-gradient(120% 140% at 105% -10%, color-mix(in srgb, var(--astyne) 18%, transparent), transparent 55%),
    radial-gradient(90% 120% at -10% 120%, color-mix(in srgb, var(--aether) 18%, transparent), transparent 60%),
    var(--surface);
}
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 750; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.hero-card h2 { font-size: clamp(30px, 4.6vw, 42px); line-height: 1.04; letter-spacing: -0.04em; font-weight: 800; margin: 14px 0 12px; text-wrap: balance; }
.hero-card h2 span { color: var(--muted); }
.hero-card p { font-size: 16px; color: var(--ink-2); max-width: 520px; line-height: 1.55; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 22px 0 24px; }
.hero-spaces { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hero-space {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 12px;
  border-radius: 16px; background: color-mix(in srgb, var(--surface-2) 70%, transparent); border: 1px solid var(--line);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.hero-space:hover { border-color: var(--line-strong); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.hero-space-text { flex: 1; display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.hero-space b { font-size: 15px; }
.hero-space small { font-size: 12.5px; color: var(--muted); }
.hero-space > .icon { color: var(--muted); }

.compose-prompt {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 12px 12px 12px 14px; margin-bottom: 14px; text-align: left; cursor: text;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.compose-prompt:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.compose-prompt-text { flex: 1; color: var(--faint); font-size: 15.5px; }

.space-hero {
  position: relative; overflow: hidden; margin: 18px 0 16px; padding: 24px;
  border-radius: 24px; border: 1px solid var(--line);
  background: radial-gradient(110% 130% at 100% 0%, var(--space-soft), transparent 62%), var(--surface);
}
.space-hero-top { display: flex; align-items: center; gap: 16px; }
.space-hero-top .space-mark { box-shadow: var(--shadow-md); }
.space-hero-text { flex: 1; min-width: 0; }
.space-hero-text h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; }
.space-hero-text p { color: var(--ink-2); font-size: 14.5px; line-height: 1.5; margin-top: 6px; max-width: 460px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--line);
  font-size: 13.5px; font-weight: 600; color: var(--ink-2); transition: border-color 0.12s, color 0.12s;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip .icon { color: var(--space-accent); }

/* Stage tracker */
.stages { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 22px; }
.stages li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 12px; line-height: 1.3; font-weight: 600; color: var(--muted); padding: 0 3px; }
.stages li::before { content: ''; position: absolute; top: 10px; left: -50%; right: 50%; height: 2px; background: var(--line-strong); }
.stages li:first-child::before { display: none; }
.stages li.done::before, .stages li.current::before { background: var(--space-accent); }
.stage-dot { position: relative; z-index: 1; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line-strong); color: #fff; }
.stage-dot .icon { stroke-width: 3; }
.done .stage-dot { background: var(--space-accent); border-color: var(--space-accent); }
.current .stage-dot { border-color: var(--space-accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--space-accent) 18%, transparent); }
.current .stage-dot::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--space-accent); }
.stages li.current { color: var(--ink); }
.stage-now { margin-top: -4px; font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--space-accent); }
.stages-sm { grid-template-columns: 1fr; gap: 0; margin: 2px 0 4px; }
.stages-sm li { flex-direction: row; text-align: left; gap: 10px; padding: 5px 0; font-size: 13px; }
.stages-sm li::before { top: -50%; bottom: 50%; left: 10px; right: auto; width: 2px; height: auto; }
.stages-sm .stage-now { margin: 0 0 0 auto; }

/* ── Rail ───────────────────────────────────────────────────────────────────────────────── */

.rail-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.rail-card h3 { font-size: 16px; font-weight: 750; letter-spacing: -0.012em; }
.rail-card > .btn { align-self: flex-start; }
.rail-welcome { background: radial-gradient(120% 120% at 100% 0%, var(--accent-soft), transparent 60%), var(--surface); }
.rail-welcome .btn { align-self: stretch; }
.space-card { background: radial-gradient(120% 120% at 100% 0%, var(--space-soft), transparent 60%), var(--surface); }
.space-card-head { display: flex; align-items: center; gap: 12px; }
.space-card-head > div { display: flex; flex-direction: column; line-height: 1.3; }
.space-card-head a { display: inline-flex; align-items: center; gap: 4px; }
.space-card-head a:hover { color: var(--ink); }
.product-links { display: flex; flex-direction: column; margin: 0 -8px; }
.product-link { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; transition: background 0.12s; }
.product-link:hover { background: var(--hover); }
.product-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.product-text b { font-size: 15px; }
.product-text small { font-size: 13px; color: var(--muted); }
.product-link > .icon { color: var(--muted); }
.rules-list { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.rules-list b { color: var(--ink); font-weight: 650; }
.rail-link { display: inline-flex; align-items: center; gap: 3px; font-size: 13.5px; font-weight: 650; color: var(--accent); }
.rail-link:hover { text-decoration: underline; }
.top-ideas { display: flex; flex-direction: column; margin: 0 -8px; }
.top-ideas a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; font-size: 14px; }
.top-ideas a:hover { background: var(--hover); }
.ti-votes {
  display: inline-flex; align-items: center; justify-content: center; gap: 1px; min-width: 46px; height: 26px; padding: 0 7px;
  border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line);
  font-weight: 700; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.ti-votes .icon { stroke-width: 2.6; }
.ti-title { flex: 1; min-width: 0; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-foot { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 0 8px; font-size: 12.5px; color: var(--faint); }
.rail-foot a:hover { color: var(--ink-2); text-decoration: underline; }

/* ── Threads & comments ─────────────────────────────────────────────────────────────────── */

.comments { margin-top: 6px; }
.comment-box { display: flex; align-items: flex-end; gap: 10px; padding: 10px 10px 10px 12px; margin-bottom: 12px; transition: border-color 0.15s, box-shadow 0.15s; }
.comment-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.comment-box textarea { flex: 1; min-width: 0; border: 0; outline: 0; resize: none; background: transparent; font-size: 15px; line-height: 1.5; padding: 7px 0; max-height: 260px; color: var(--ink); }
.comment-gate { width: 100%; display: flex; align-items: center; gap: 10px; padding: 14px 16px; margin-bottom: 12px; color: var(--ink-2); font-weight: 650; text-align: left; }
.comment-gate span { flex: 1; }
.comment-gate:hover { border-color: var(--line-strong); }
.comment-list { display: flex; flex-direction: column; gap: 2px; }
.comments-empty { padding: 8px 4px 20px; }
.comment { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 11px; padding: 10px 10px 12px; border-radius: 14px; transition: background 0.12s; }
.comment:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.comment.by-team { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.comment-main { min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 5px; font-size: 14px; min-height: 26px; }
.comment-head .name { font-weight: 650; }
.comment-head a.name:hover { text-decoration: underline; }
.comment-head .handle, .comment-head .dot, .comment-head time { color: var(--muted); white-space: nowrap; }
.comment-head .handle { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.comment-more { margin-left: auto; width: 30px; height: 30px; opacity: 0; }
.comment:hover .comment-more, .comment-more:focus-visible { opacity: 1; }
@media (hover: none) { .comment-more { opacity: 0.7; } }
.comment .prose { font-size: 15px; line-height: 1.55; }
.locked-note { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; padding: 10px 4px 16px; }

/* ── Roadmap ────────────────────────────────────────────────────────────────────────────── */

.stage-card { padding: 18px 20px 20px; margin-bottom: 14px; background: radial-gradient(120% 140% at 100% 0%, var(--space-soft), transparent 60%), var(--surface); }
.stage-card-head { display: flex; align-items: center; gap: 12px; }
.stage-card-head h2 { font-size: 16px; font-weight: 750; }
.stage-card-head > div { display: flex; flex-direction: column; line-height: 1.3; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(148px, 1fr); gap: 8px; overflow-x: auto; padding-bottom: 8px; align-items: start; scrollbar-width: thin; }
.board-col { display: flex; flex-direction: column; gap: 8px; min-height: 140px; padding: 12px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); }
.board-col h3 { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 750; padding: 2px 4px 6px; }
.board-col h3 .count { margin-left: auto; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.status[class*='status-dot-'] { width: 9px; height: 9px; padding: 0; border-radius: 50%; }
.status-dot-under-review { background: var(--st-amber); }
.status-dot-planned { background: var(--st-blue); }
.status-dot-in-progress { background: var(--st-violet); }
.status-dot-shipped { background: var(--st-green); }
.board-card {
  display: flex; flex-direction: column; gap: 8px; padding: 11px 12px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  font-size: 14px; font-weight: 600; line-height: 1.4; transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.board-card:hover { box-shadow: var(--shadow-sm); border-color: var(--line-strong); transform: translateY(-1px); }
.board-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 500; }
.board-meta .ti-votes { min-width: 0; height: 22px; font-size: 12px; }
.board-space { display: inline-flex; align-items: center; gap: 5px; }
.board-empty { font-size: 13px; color: var(--faint); padding: 6px 4px; }

/* ── Profile & settings ─────────────────────────────────────────────────────────────────── */

.profile-hero { display: flex; flex-direction: column; gap: 10px; padding: 30px 4px 6px; }
.profile-id h1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 27px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.profile-id .handle { color: var(--muted); font-size: 15px; }
.profile-bio { font-size: 15.5px; color: var(--ink-2); max-width: 520px; }
.profile-hero p.muted { display: flex; align-items: center; gap: 6px; }
.profile-actions { display: flex; gap: 8px; }

.settings-card { padding: 20px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 14px; }
.settings-card h2 { font-size: 16px; font-weight: 750; letter-spacing: -0.012em; }
.settings-card a { text-decoration: underline; }
.settings-card .btn { text-decoration: none; }
.settings-form { display: flex; flex-direction: column; gap: 14px; }
.settings-avatar { display: flex; align-items: center; gap: 12px; }
.settings-avatar > div { display: flex; flex-direction: column; }
.settings-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.toggle-list { display: flex; flex-direction: column; }
.toggle-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.toggle-row:first-child { border-top: 0; padding-top: 0; }
.toggle-text { flex: 1; display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.toggle-row small { font-size: 13px; color: var(--muted); }
.toggle-row > .icon { color: var(--muted); margin: 0 3px; }
.kv { display: flex; flex-direction: column; gap: 10px; }
.kv > div { display: flex; gap: 12px; font-size: 14px; }
.kv dt { width: 116px; color: var(--muted); flex-shrink: 0; }
.kv dd { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; overflow-wrap: anywhere; }

/* ── Moderation ─────────────────────────────────────────────────────────────────────────── */

.report { padding: 16px 18px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.report-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.report-note { font-size: 14px; color: var(--ink-2); font-style: italic; }
.report-target { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; }
.report-target a { color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.report-author { display: flex; align-items: center; gap: 7px; }
.report-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Empty & loading ────────────────────────────────────────────────────────────────────── */

.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 56px 20px; text-align: center; color: var(--muted); }
.empty-icon { width: 56px; height: 56px; margin-bottom: 8px; display: grid; place-items: center; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); box-shadow: var(--shadow-sm); }
.empty h3 { color: var(--ink); font-size: 17px; font-weight: 750; letter-spacing: -0.01em; }
.empty p { font-size: 14.5px; max-width: 360px; line-height: 1.5; }
.empty .btn { margin-top: 10px; }
.skeleton { padding: 18px 20px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 11px; }
.sk { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--hover) 25%, var(--active) 37%, var(--hover) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.sk-row { display: flex; align-items: center; gap: 10px; }
.sk-av { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.sk-line { height: 12px; }
.w40 { width: 40%; } .w60 { width: 60%; } .w80 { width: 80%; } .w95 { width: 95%; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.feed-more { margin: 8px 0 24px; }

/* ── Modals ─────────────────────────────────────────────────────────────────────────────── */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; overflow-y: auto;
  display: grid; place-items: center; padding: 24px;
  background: rgba(8, 8, 12, 0.5);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.2s;
}
.modal-backdrop.in { opacity: 1; }
.modal {
  position: relative; width: min(520px, 100%); max-height: calc(100dvh - 48px); overflow-y: auto;
  background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-lg); outline: none;
  transform: translateY(10px) scale(0.985); transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal-backdrop.in .modal { transform: none; }
.modal-sm { width: min(430px, 100%); }
.modal-auth { width: min(448px, 100%); }
.modal-compose { width: min(640px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 16px 0 24px; }
.modal-head h2 { font-size: 19px; font-weight: 750; letter-spacing: -0.015em; padding-top: 6px; }
.modal-head p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.modal-body { display: flex; flex-direction: column; gap: 14px; padding: 16px 24px 22px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.confirm-title { font-size: 19px; font-weight: 750; letter-spacing: -0.015em; padding-top: 8px; }
.confirm-msg { color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }
.modal-lightbox { width: auto; max-width: 96vw; background: transparent; box-shadow: none; overflow: visible; }
.modal-lightbox img { max-width: 94vw; max-height: 88dvh; border-radius: 14px; box-shadow: var(--shadow-lg); }
.lightbox-close { position: fixed; top: 16px; right: 16px; background: rgba(0, 0, 0, 0.55); color: #fff; }
.lightbox-close:hover { background: rgba(0, 0, 0, 0.75); color: #fff; }

/* Auth */
.auth { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 26px 28px 24px; }
.auth > .modal-close { position: absolute; top: 14px; right: 14px; }
.auth-brand { display: flex; align-items: center; gap: 8px; height: 26px; }
.auth-brand .wm { height: 20px; }
.auth-steps { display: flex; gap: 6px; margin-top: 2px; }
.auth-steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--line); transition: background 0.3s; }
.auth-steps span.on { background: var(--ink); }
.auth-title { font-size: 25px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.18; text-wrap: balance; }
.auth-sub { color: var(--muted); font-size: 14.5px; line-height: 1.5; margin-top: -6px; }
.auth-sub strong { color: var(--ink); overflow-wrap: anywhere; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form > fieldset { border: 0; }
.or { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--faint); }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.legal-note { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.legal-note a { color: var(--ink-2); text-decoration: underline; }
.teen-note { display: flex; gap: 9px; align-items: flex-start; padding: 11px 13px; border-radius: 12px; background: var(--accent-soft); color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.teen-note .icon { margin-top: 1px; color: var(--accent); }
.auth-alt { text-align: center; font-size: 14px; color: var(--muted); }
.back-btn { align-self: center; color: var(--muted); font-size: 14px; }
.auth-center { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding-top: 8px; }
.auth-icon { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 20px; background: var(--active); color: var(--ink); }
.auth-row { display: flex; gap: 6px; }
.profile-preview { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.profile-preview > div { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.profile-preview strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-preview span { color: var(--muted); font-size: 13.5px; }
.input-affix { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); transition: border-color 0.15s, box-shadow 0.15s; }
.input-affix > span { padding-left: 14px; color: var(--muted); font-weight: 600; }
.input-affix .input { border: 0; box-shadow: none !important; padding-left: 3px; background: transparent; }
.input-affix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.follow-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.follow-chip {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 8px;
  border-radius: 999px; border: 1px solid var(--line-strong); font-weight: 650; font-size: 14px; cursor: pointer; user-select: none;
  transition: border-color 0.15s, background 0.15s;
}
.follow-chip input { position: absolute; opacity: 0; pointer-events: none; }
.follow-chip .tick { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: transparent; transition: background 0.15s; }
.follow-chip .tick .icon { stroke-width: 3; }
.follow-chip:has(input:checked) { border-color: var(--ink); background: var(--surface-2); }
.follow-chip:has(input:checked) .tick { background: var(--ink); color: var(--surface); }
.follow-chip:has(input:focus-visible) { box-shadow: 0 0 0 4px var(--accent-ring); }

/* Compose */
.compose { gap: 10px; }
.compose-where { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.select-pill { position: relative; display: inline-flex; align-items: center; }
.select-pill select {
  appearance: none; -webkit-appearance: none; height: 32px; padding: 0 28px 0 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); font-size: 13.5px; font-weight: 650; color: var(--ink); cursor: pointer;
}
.select-pill select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.select-pill .icon { position: absolute; right: 9px; pointer-events: none; color: var(--muted); }
.compose-title { width: 100%; border: 0; outline: 0; background: transparent; font-size: 21px; font-weight: 750; letter-spacing: -0.02em; padding-top: 6px; color: var(--ink); }
.compose-body { width: 100%; border: 0; outline: 0; background: transparent; resize: none; font-size: 16px; line-height: 1.55; min-height: 120px; max-height: 50dvh; color: var(--ink); }
.compose-foot { display: flex; align-items: center; gap: 10px; margin-top: 2px; padding-top: 12px; border-top: 1px solid var(--line); }
.compose-tools { flex: 1; display: flex; align-items: center; gap: 2px; margin-left: -8px; }
.compose-note { display: inline-flex; align-items: center; gap: 5px; margin-left: 6px; font-size: 12.5px; color: var(--muted); }
.counter { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.warn { color: var(--danger); }
.compose-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.compose-media:empty { display: none; }
.media-tile { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--hover); }
.media-tile img, .media-tile video { width: 100%; height: 100%; object-fit: cover; }
.media-tile.busy img, .media-tile.busy video { opacity: 0.55; }
.media-progress { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.45); overflow: hidden; }
.media-progress span { display: block; height: 100%; background: #fff; transition: width 0.2s; }
.media-remove { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.62); color: #fff; }
.poll-editor { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); }
.poll-editor legend { padding: 0 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.poll-edit-row { display: flex; align-items: center; gap: 6px; }
.poll-edit-row .input { height: 40px; }
.poll-editor .link-btn { align-self: flex-start; font-size: 13.5px; }
.similar { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); font-size: 13.5px; }
.similar-label { font-size: 11.5px; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.similar a { display: flex; align-items: center; gap: 6px; color: var(--ink); }
.similar a:hover { text-decoration: underline; }

/* Composer tools: labelled, so "Video" is findable */
.tool-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 10px; border-radius: 999px;
  color: var(--ink-2); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background 0.12s, color 0.12s;
}
.tool-btn:hover { background: var(--hover); color: var(--ink); }
.tool-btn.on { color: var(--accent); background: var(--accent-soft); }
.tool-btn .icon { color: var(--muted); }
.tool-btn.on .icon { color: var(--accent); }
.media-kind { position: absolute; left: 6px; bottom: 6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.62); color: #fff; }

/* Space editor (team & developers) */
.space-hero-cta { display: flex; gap: 8px; align-items: center; }
.space-card-head .edit-space, .stage-card-head .edit-space { margin-left: auto; align-self: flex-start; }
.space-editor { gap: 16px; }
.space-editor-id { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.field-pair { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
.editor-section { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.editor-section > legend { float: left; width: 100%; margin-bottom: 2px; font-size: 14.5px; color: var(--ink); }
.stage-edit-list { display: flex; flex-direction: column; gap: 6px; }
.stage-edit-row { display: flex; align-items: center; gap: 4px; }
.stage-edit-row .input { height: 40px; flex: 1; margin: 0 4px; }
.stage-edit-row .icon-btn:disabled { opacity: 0.3; pointer-events: none; }
.stage-current { display: grid; place-items: center; width: 32px; height: 32px; cursor: pointer; }
.stage-current input { width: 18px; height: 18px; accent-color: var(--aether); cursor: pointer; }
.editor-section .link-btn { align-self: flex-start; font-size: 13.5px; }
.channel-edit-row { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 10px; }
.channel-edit-row > span { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); min-width: 0; }
.channel-edit-row .input { height: 40px; }
@media (max-width: 600px) {
  .field-pair, .channel-edit-row { grid-template-columns: 1fr; }
  .channel-edit-row { gap: 4px; }
  .space-hero-cta { width: 100%; }
  .space-hero-cta .btn { flex: 1; }
}

/* Report form */
.radio-list { display: flex; flex-direction: column; gap: 1px; margin: -4px -8px 0; }
.radio { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; font-size: 14.5px; cursor: pointer; }
.radio:hover { background: var(--hover); }
.radio input { width: 18px; height: 18px; accent-color: var(--ink); }

/* ── Menus & toasts ─────────────────────────────────────────────────────────────────────── */

.menu {
  position: absolute; z-index: 150; min-width: 216px; padding: 6px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  animation: menu-in 0.14s ease-out;
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 10px; border-radius: 9px; font-size: 14px; font-weight: 550; text-align: left; color: var(--ink); }
.menu-item .icon { color: var(--muted); }
.menu-item:hover, .menu-item:focus-visible { background: var(--hover); outline: none; }
.menu-item.danger, .menu-item.danger .icon { color: var(--danger); }
.menu-sep { height: 1px; margin: 5px 4px; background: var(--line); }

#toast-root { position: fixed; left: 50%; bottom: 24px; z-index: 200; width: min(92vw, 480px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  padding: 12px 18px; border-radius: 14px; background: var(--ink); color: var(--bg);
  font-size: 14px; font-weight: 550; line-height: 1.4; text-align: center; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(8px) scale(0.98); transition: opacity 0.2s, transform 0.2s;
}
.toast.in { opacity: 1; transform: none; }
.toast-error { background: var(--danger); color: #fff; }

/* ── Responsive ─────────────────────────────────────────────────────────────────────────── */

@media (max-width: 1200px) {
  .columns { grid-template-columns: minmax(0, 680px); }
  .rail { display: none; }
  #banner { max-width: 736px; }
}

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(86vw, 320px);
    transform: translateX(-102%); transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(8, 8, 12, 0.4); opacity: 0; pointer-events: none; transition: opacity 0.25s; }
  .scrim.on { opacity: 1; pointer-events: auto; }
  .topbar {
    display: flex; align-items: center; gap: 6px; position: sticky; top: 0; z-index: 40;
    height: 56px; padding: 0 12px 0 8px;
    background: color-mix(in srgb, var(--bg) 84%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
    border-bottom: 1px solid var(--line);
  }
  .topbar-title { flex: 1; display: flex; align-items: center; gap: 9px; min-width: 0; font-weight: 750; font-size: 16px; }
  .topbar-title > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-end { display: flex; align-items: center; }
  .columns { padding: 0 16px 104px; }
  #banner { padding: 12px 16px 0; }
  .page-head { top: 56px; margin: 0 -16px 14px; padding: 14px 16px 0; }
  .page-head:not(:has(.tabs)) { padding-bottom: 12px; }
  .fab { display: grid; }
  #toast-root { bottom: calc(92px + env(safe-area-inset-bottom)); }
}

@media (max-width: 600px) {
  body { font-size: 15px; }
  .modal-backdrop { place-items: end center; padding: 0; }
  .modal, .modal-sm, .modal-auth, .modal-compose { width: 100%; max-height: 94dvh; border-radius: 24px 24px 0 0; transform: translateY(40px); padding-bottom: env(safe-area-inset-bottom); }
  .modal-lightbox { border-radius: 0; place-self: center; }
  .auth { padding: 24px 20px 22px; }
  .modal-body { padding: 14px 20px 20px; }
  .modal-head { padding-left: 20px; }
  .post { padding: 16px; border-radius: 16px; }
  .post-update { padding: 18px 16px 14px; }
  .post-update .post-title { font-size: 20px; }
  .post-update.is-full .post-title { font-size: 25px; }
  .post-idea { grid-template-columns: 46px minmax(0, 1fr); gap: 12px; padding: 14px 14px 12px; }
  .vote-btn { width: 46px; height: 56px; font-size: 14px; border-radius: 12px; }
  .post-discussion { grid-template-columns: 38px minmax(0, 1fr); gap: 10px; }
  .post-discussion > .author-link .avatar { --av-size: 38px !important; }
  .byline .handle { display: none; }
  .hero-card { padding: 24px 18px 18px; border-radius: 20px; }
  .hero-spaces { grid-template-columns: 1fr; }
  .space-hero { padding: 18px; border-radius: 20px; }
  .space-hero-top { flex-wrap: wrap; }
  .space-hero-top .space-mark { --sm-size: 52px !important; width: 52px; height: 52px; }
  .space-hero-text h1 { font-size: 25px; }

  /* Six labels don't fit across a phone: stack the tracker, same as the rail's compact one. */
  .stages { grid-template-columns: 1fr; gap: 0; margin-top: 18px; }
  .stages li { flex-direction: row; text-align: left; gap: 10px; padding: 5px 0; font-size: 13.5px; }
  .stages li::before { top: -50%; bottom: 50%; left: 10px; right: auto; width: 2px; height: auto; }
  .stage-now { margin: 0 0 0 auto; }
  .kv > div { flex-direction: column; gap: 2px; }
  .dob { grid-template-columns: 1.3fr 0.8fr 1fr; }
  .board { grid-auto-columns: 76%; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 8px; scroll-padding: 0 16px; }
  .board-col { scroll-snap-align: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
