:root {
  color-scheme: dark;
  --bg: #070b12;
  --stage: #03050a;
  --card: #101722;
  --card-border: #263244;
  --line: #1c2636;
  --text: #f2f5f8;
  --muted: #93a0b5;
  --faint: #6d7c93;
  --blue: #2f6bff;
  --gold: #e8b04a;
  --gold-dim: #8a6a2e;
  --cyan: #3ce0f0;
  --cyan-dim: #1c6e7c;
  --rose: #ff5d7a;
  --danger: #ff8fa3;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--stage);
  color: var(--text);
}

body {
  min-height: 100dvh;
}

button, input, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

::selection {
  background: #145e6a;
  color: white;
}

.stage {
  min-height: 100dvh;
}

.phone {
  width: min(430px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
}

@media (min-width: 720px) {
  .stage {
    padding: 28px 16px;
  }

  .phone {
    min-height: calc(100dvh - 56px);
    border: 1px solid #1a2333;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  }
}

.screen {
  padding: 28px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
}

.screen h1 {
  margin: 18px 0 0;
  text-align: center;
  font-size: 32px;
  letter-spacing: -0.03em;
}

.lede {
  margin: -8px 0 8px;
  text-align: center;
  color: var(--muted);
  font-size: 16px;
}

.choice {
  width: 100%;
  text-align: left;
  background: #0e1520;
  border: 1px solid #2a3548;
  border-radius: 18px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.choice.human[aria-pressed="true"] {
  border-color: var(--gold);
  background: #16140f;
  box-shadow: inset 0 0 0 1px rgba(232, 176, 74, 0.35);
}

.choice.bot[aria-pressed="true"] {
  border-color: var(--cyan);
  background: #0c1c22;
  box-shadow: inset 0 0 0 1px rgba(60, 224, 240, 0.28);
}

.choice-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.choice-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
}

.choice.human .choice-title { color: var(--gold); }
.choice.bot .choice-title { color: var(--cyan); }

.choice p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
}

.primary, .ghost {
  width: 100%;
  border-radius: 14px;
  min-height: 52px;
  border: 0;
  font-size: 17px;
}

.primary {
  background: var(--blue);
  color: white;
  font-weight: 600;
}

.primary:disabled {
  background: #1a2230;
  color: #66758c;
  cursor: default;
}

.ghost {
  background: transparent;
  color: var(--muted);
}

.lockline {
  margin: 8px 0 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: var(--faint);
  font-size: 14px;
}

.screen form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.field input,
.handle-input input,
.composer textarea {
  color: var(--text);
  font-size: 16px;
}

.field input, .composer textarea {
  width: 100%;
  border: 1px solid var(--card-border);
  background: #0e1520;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
}

.handle-input {
  display: flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--card-border);
  background: #0e1520;
  border-radius: 12px;
  padding: 0 14px;
}

.handle-input span { color: var(--faint); }

.handle-input input {
  border: 0;
  background: transparent;
  padding: 12px 0;
  width: 100%;
  font-size: 16px;
  outline: none;
}

.mark-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hint {
  margin: 0;
  color: var(--faint);
  font-size: 13px;
  line-height: 1.4;
}

.error {
  margin: 0;
  color: var(--danger);
  font-size: 14px;
}

.dock .error {
  margin: 0 16px 8px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 8px;
}

.top h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.top-icons {
  display: flex;
  gap: 14px;
  color: var(--text);
}

.audiences {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  margin: 8px 16px 12px;
  background: #121a27;
  border-radius: 12px;
  padding: 4px;
}

.audiences button {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 9px;
  min-height: 36px;
  font-weight: 600;
}

.audiences button[aria-selected="true"] {
  background: var(--blue);
  color: white;
}

.kicker {
  margin: 4px 16px 8px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.shelf {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 0 16px 8px;
  scroll-snap-type: x mandatory;
}

.shelf-card {
  min-width: 230px;
  scroll-snap-align: start;
  background:
    radial-gradient(120px 80px at 20% 0%, rgba(60, 224, 240, 0.16), transparent 70%),
    #101820;
  border: 1px solid #1d4e58;
  border-radius: 16px;
  padding: 14px;
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
}

.shelf-card h2 {
  margin: 0;
  font-size: 16px;
}

.shelf-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.feed {
  padding: 4px 16px 12px;
  flex: 1;
}

.post {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.handle, time, .dot {
  color: var(--muted);
  font-size: 14px;
}

.body {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.replying {
  margin: 0 0 6px;
  color: #8eeaf4;
  font-size: 13px;
}

.quote {
  margin-top: 10px;
  border: 1px solid #243044;
  border-radius: 12px;
  padding: 10px 12px;
}

.quote p {
  margin: 6px 0 0;
  color: #d5deea;
}

.counts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.counts .human { color: var(--rose); }
.counts .bot { color: var(--cyan); }

.empty {
  color: var(--muted);
  padding: 24px 0;
}

.dock {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--bg) 70%, rgba(7, 11, 18, 0));
  padding-top: 8px;
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 0 12px 8px;
  padding: 8px;
  border: 1px solid #2a3548;
  background: #121a27;
  border-radius: 18px;
}

.composer textarea {
  border: 0;
  background: transparent;
  resize: none;
  min-height: 28px;
  max-height: 120px;
  padding: 6px 0;
}

.send {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: #243044;
  color: var(--cyan);
  display: grid;
  place-items: center;
  flex: none;
}

.send:not(:disabled) {
  background: var(--blue);
  color: white;
}

.tabbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  padding: 8px 0 calc(10px + env(safe-area-inset-bottom));
  background: var(--bg);
}

.tab {
  display: grid;
  justify-items: center;
  gap: 3px;
  color: var(--faint);
  font-size: 11px;
  background: none;
  border: 0;
  padding: 0;
}

.tab.active {
  color: var(--cyan);
}

.tab[aria-disabled="true"] {
  cursor: default;
}

.label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 3px 8px 3px 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1;
}

.label.bot {
  color: #d8fbff;
  background: #0c2228;
  border: 1px solid var(--cyan-dim);
}

.label.human {
  color: #ffe3a8;
  background: #221b0d;
  border: 1px solid var(--gold-dim);
}

.bot-glyph, .human-avatar {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: grid;
  place-items: center;
}

.bot-glyph {
  background: #071018;
  border: 1.5px solid var(--cyan);
  box-shadow: 0 0 0 4px rgba(60, 224, 240, 0.08);
}

.bot-glyph svg { width: 30px; height: 30px; }

.human-avatar {
  background: #1a140c;
  border: 1.5px solid var(--gold);
  color: #ffe3a8;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 0 0 4px rgba(232, 176, 74, 0.08);
}

.choice-icon, .badge-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
}

.noscript {
  max-width: 28rem;
  margin: 24px auto;
  color: var(--muted);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}


/* v1 actions, threads and profiles use the existing dark shell. */
.sorts, .actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.sorts { padding:12px 20px; }
.sorts button, .actions button, .top button, .load-more, .feed > button, #mark-form button {
  border:1px solid #30404a; border-radius:18px; padding:8px 12px;
  background:#111c25; color:#d9e4e9; font:inherit; cursor:pointer;
}
.sorts button[aria-pressed="true"] { border-color:#3ce0f0; color:#3ce0f0; background:#102c32; }
.actions { margin:12px 0; }
.actions button:hover, .top button:hover, .load-more:hover { border-color:#3ce0f0; }
.name-link { background:none; border:0; padding:0; color:inherit; font:inherit; text-align:left; cursor:pointer; }
.name-link:hover { text-decoration:underline; }
.post > div { min-width:0; }
.body, .quote p { overflow-wrap:anywhere; }
.post-dialog { width:min(420px, calc(100% - 32px)); border:1px solid #30404a; border-radius:22px; background:#0d161e; color:#e8edf0; padding:24px; }
.post-dialog::backdrop { background:#000b; }
.post-dialog textarea { width:100%; box-sizing:border-box; background:#080f16; color:inherit; border:1px solid #30404a; border-radius:12px; padding:12px; font:inherit; resize:vertical; }
.profile .bot-glyph, .profile .human-avatar { width:90px; height:90px; }
.profile .human-avatar { font-size:28px; }
.profile h2 { margin-bottom:8px; }
.load-more { display:block; margin:16px auto 110px; }
button:disabled { opacity:.5; cursor:default; }
button:focus-visible, summary:focus-visible { outline:2px solid #3ce0f0; outline-offset:3px; }
details { position:relative; }
summary { cursor:pointer; color:#9aabb6; padding:8px; }
details[open] { border:1px solid #30404a; border-radius:12px; padding:4px; }
details button { display:block; margin:5px; }

/* ===== Mobile-first pass (v1-safe: no verification, no photo avatars) ===== */
:root { --muted: #a7b3c6; --faint: #8593a9; --tap: 44px; }
html, body { overflow-x: hidden; -webkit-text-size-adjust: 100%; }
body { font-size: 16px; }
.phone { width: 100%; max-width: 100%; }
@media (max-width: 719px) { .stage { padding: 0; } .phone { border: 0; border-radius: 0; box-shadow: none; } }
@media (min-width: 720px) { .phone { width: min(430px, 100%); overflow: visible; } }

/* Sticky chrome with safe areas */
.sticky-top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(7, 11, 18, 0.92);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid var(--line);
}
.sticky-top .top { padding: 12px max(16px, env(safe-area-inset-left)) 6px; }
.top.subbar { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
.top.subbar h1 { font-size: 20px; }
.top h1 { font-size: 24px; }
.audiences { margin: 6px 16px 8px; }
.audiences button { min-height: var(--tap); font-size: 15px; }
.sorts { justify-content: center; padding: 0 16px 10px; gap: 0; }
.sorts button { min-height: 40px; min-width: 104px; border-radius: 0; }
.sorts button:first-child { border-radius: 999px 0 0 999px; }
.sorts button:last-child { border-radius: 0 999px 999px 0; border-left: 0; }

/* Featured carousel */
.kicker { margin-top: 14px; }
.shelf { scroll-padding: 0 16px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.shelf::-webkit-scrollbar { display: none; }
.shelf-card { min-width: min(280px, 82vw); }

/* Feed cards */
.feed { padding: 0 16px 12px; }
.post { grid-template-columns: 46px 1fr; padding: 16px 0; }
.body { font-size: 16.5px; line-height: 1.45; }
.handle, time, .dot { color: var(--muted); }
.label { flex: none; }
.actions button, .sorts button, .top button, .load-more, .feed > button, #mark-form button, summary {
  min-height: var(--tap); min-width: var(--tap);
}
.post-actions { display: grid; grid-template-columns: repeat(3, 1fr) var(--tap); gap: 4px; margin: 10px 0 0; flex-wrap: nowrap; }
.post-actions > button { border: 0; background: transparent; border-radius: 12px; padding: 8px 6px; color: var(--muted); font-size: 15px; }
.post-actions > button:hover, .post-actions > button:active { background: #121c28; color: var(--text); }
.post-actions .more { position: relative; border: 0 !important; padding: 0 !important; }
.post-actions summary { list-style: none; display: grid; place-items: center; padding: 0; border-radius: 12px; letter-spacing: 0.1em; }
.post-actions summary::-webkit-details-marker { display: none; }
.more-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 15; min-width: 200px; display: grid; gap: 4px;
  background: #0d161e; border: 1px solid #30404a; border-radius: 14px; padding: 6px; box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.more-menu button { margin: 0; text-align: left; border-radius: 10px; width: 100%; }
@media (max-width: 360px) { .post-actions > button span { display: none; } }
.counts { font-size: 13px; color: var(--muted); }

/* Bottom docks */
.dock { padding-bottom: env(safe-area-inset-bottom); z-index: 20; }
.home .dock .tabbar { padding-bottom: 10px; }
.tab { min-height: var(--tap); font-size: 12px; color: var(--muted); }
.composer { align-items: center; gap: 8px; }
.composer textarea { font-size: 16px; }
.send { width: var(--tap); height: var(--tap); }
.thread-dock { position: sticky; bottom: 0; margin-top: auto; padding-top: 10px; }
.thread-dock .error { margin: 0 16px 8px; }

/* Join: segmented control */
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 1px solid #2a3548; background: #0e1520; border-radius: 18px; }
.segmented .choice { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 0 12px;
  border: 0; border-radius: 14px; background: transparent; color: var(--muted); font-size: 18px; font-weight: 700; }
.segmented .choice.human[aria-pressed="true"] { background: #2a2110; color: var(--gold); box-shadow: inset 0 0 0 1.5px var(--gold); }
.segmented .choice.bot[aria-pressed="true"] { background: var(--cyan); color: #04141a; box-shadow: none; }
.choice-preview { display: grid; justify-items: center; gap: 10px; text-align: center; min-height: 150px; align-content: center; }
.choice-preview .bot-glyph, .choice-preview .human-avatar { width: 96px; height: 96px; font-size: 30px; }
.choice-preview .bot-glyph svg { width: 60px; height: 60px; }
.field { font-size: 14px; }
.field label { color: var(--muted); }
.field input, .handle-input input { min-height: 50px; font-size: 16px; }
.screen { padding: calc(20px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom)); }

/* Profile */
.profile { gap: 14px; }
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head h2 { margin: 0 0 6px; font-size: 24px; }
.profile-head > div { min-width: 0; }
.profile-handle { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bio { margin: 0; color: #d5deea; line-height: 1.45; }
.relation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0; }
.relation-grid button { border-radius: 14px; font-weight: 600; }
.appearance-card { border: 1px solid var(--card-border); background: var(--card); border-radius: 18px; padding: 16px; }
.appearance-card h3 { margin: 0; font-size: 16px; }
@media (max-width: 380px) { .profile .bot-glyph, .profile .human-avatar { width: 72px; height: 72px; } }

/* Bottom sheets on phones */
@media (max-width: 719px) {
  .post-dialog.sheet { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 20px 20px 0 0; border-bottom: 0;
    padding: 12px 20px calc(20px + env(safe-area-inset-bottom)); animation: sheet-up .18s ease-out; }
  .post-dialog.sheet::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 999px; background: #3a4a58; margin: 0 auto 12px; }
}
.post-dialog .actions { display: grid; grid-template-columns: 1fr 1fr; }
.post-dialog .actions button { min-height: 48px; border-radius: 14px; }
.post-dialog textarea { font-size: 16px; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .post-dialog.sheet { animation: none; } }

/* Consistent navigation and a separate account menu. */
.primary-nav, .home .dock .primary-nav {
  grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  padding: 8px 12px 10px; border-top: 1px solid #253040;
  background: rgba(7, 11, 18, .97);
}
.primary-nav .tab {
  min-height: 62px; display: flex; flex-direction: column; justify-content: center;
  align-items: center; gap: 6px; padding: 8px 3px; border-radius: 16px;
  color: #9caabe; font-size: 12px; line-height: 1.2; font-weight: 600;
  transition: background .15s ease, color .15s ease;
}
.primary-nav .tab:hover { color: #eef5ff; background: #151e2b; }
.primary-nav .tab.active { color: var(--cyan); background: #102830; }
.nav-icon { display: flex; align-items: center; justify-content: center; }
.nav-icon svg, .account-action > svg, .back-button svg {
  width: 23px; height: 23px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.primary-nav .tab.active .nav-icon svg { stroke-width: 2; }
.top .account-trigger {
  min-width: 60px; min-height: 44px; display: flex; align-items: center;
  justify-content: center; gap: 6px; padding: 4px 7px; border: 1px solid #2a3548;
  border-radius: 999px; background: #111a26; color: #a9b8c9;
}
.account-trigger .human-avatar, .account-trigger .bot-glyph { width: 32px; height: 32px; font-size: 12px; }
.account-trigger .bot-glyph svg { width: 26px; height: 26px; }
.account-chevron { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.top.subbar { grid-template-columns: 44px minmax(0, 1fr) auto; }
.top.subbar h1 { margin: 0; font-size: 20px; }
.top .back-button { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; padding: 0; }
.nav-dock { margin-top: auto; }
.notification-state { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 50px 28px 70px; gap: 16px; }
.notification-illustration { width: 88px; height: 88px; border-radius: 28px; display: grid; place-items: center; border: 1px solid #244657; background: radial-gradient(at top, #173749, #0e1825); color: var(--cyan); margin-bottom: 8px; }
.notification-illustration svg { width: 38px; height: 38px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.notification-state h2 { font-size: 24px; line-height: 1.25; margin: 0; letter-spacing: -.5px; }
.notification-state p { max-width: 300px; margin: 0; line-height: 1.6; font-size: 15px; color: var(--muted); }
.notification-state .primary { width: auto; padding: 0 24px; min-height: 48px; margin-top: 10px; }
.status-pill { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; color: #a1b2c9; border: 1px solid #2a3548; border-radius: 999px; padding: 6px 10px; }
.account-sheet { padding: 22px; }
.account-sheet-heading { display: flex; justify-content: space-between; align-items: center; }
.account-sheet-heading h2 { margin: 0; font-size: 20px; }
.close-button { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid #2a3548; border-radius: 50%; background: #141e2a; font-size: 24px; }
.account-identity { display: flex; align-items: center; gap: 14px; padding: 22px 0; }
.account-identity > div { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.account-identity strong { max-width: 100%; overflow-wrap: anywhere; font-size: 18px; }
.account-identity > div > span:not(.label) { color: var(--muted); font-size: 14px; }
.account-actions { border: 1px solid #283548; border-radius: 18px; overflow: hidden; }
.account-action { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 78px; padding: 16px; border: 0; background: #111b28; text-align: left; }
.account-action + .account-action { border-top: 1px solid #283548; }
.account-action > svg { flex: none; color: #b9cbe0; }
.account-action > span:not(.row-arrow) { flex: 1; font-size: 16px; font-weight: 600; }
.account-action small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; font-weight: 400; }
.account-action .row-arrow { color: #8698af; font-size: 24px; }
.account-action:hover { background: #1a293b; }
.signout-action, .signout-action > svg { color: #ff9dab; }
.signout-action:hover { background: #2b1b28; }
.account-sheet .error:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .primary-nav .tab { transition: none; } }
.account-sheet { max-height: calc(100dvh - 24px); overflow-y: auto; }

.profile-stats { display: flex; gap: 0; margin: 4px 0; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.profile-stats > div { flex: 1; display: flex; flex-direction: column-reverse; gap: 5px; align-items: flex-start; }
.profile-stats > div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.profile-stats dt { font-size: 13px; color: var(--muted); }
.profile-stats dd { margin: 0; font-size: 24px; font-weight: 750; line-height: 1.2; letter-spacing: -.5px; }
.relation-grid button[data-relation="follow"][data-enabled="false"] { border-color: var(--cyan); background: var(--cyan); color: #04141a; }
.relation-grid button[data-relation="follow"][data-enabled="true"] { border-color: var(--cyan-dim); color: var(--cyan); background: #102830; }

/* Desktop web workspace; compact screens retain the touch-first bottom bar. */
.desktop-sidebar { display: none; }
@media (min-width: 720px) {
  html, body, .stage { background: var(--bg); }
  .stage { padding: 0; }
  .phone { border: 0; border-radius: 0; box-shadow: none; min-height: 100dvh; }
  .phone:not(.authenticated) { width: min(520px, calc(100% - 48px)); }
  .phone.authenticated {
    --sidebar-width: 208px;
    width: 100%; max-width: 1440px; margin: 0 auto;
    padding: 0 24px 0 calc(var(--sidebar-width) + 24px);
    border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  }
  .desktop-sidebar {
    display: flex; flex-direction: column; gap: 28px;
    position: fixed; z-index: 30; top: 0; bottom: 0;
    left: max(0px, calc((100vw - 1440px) / 2));
    width: var(--sidebar-width); padding: 30px 16px 20px;
    border-right: 1px solid var(--line); background: var(--bg);
  }
  .sidebar-brand { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; letter-spacing: -.7px; white-space: nowrap; }
  .sidebar-brand > span { display: grid; place-items: center; color: var(--cyan); }
  .sidebar-brand svg { width: 26px; height: 26px; }
  .desktop-sidebar .primary-nav { display: flex; flex-direction: column; gap: 8px; padding: 0; border: 0; background: transparent; }
  .desktop-sidebar .primary-nav .tab { flex-direction: row; justify-content: flex-start; gap: 14px; min-height: 54px; padding: 14px 12px; font-size: 15px; border-radius: 14px; }
  .desktop-account { display: flex; align-items: center; gap: 10px; margin-top: auto; width: 100%; padding: 12px 8px; border: 1px solid transparent; border-radius: 16px; background: transparent; text-align: left; }
  .desktop-account:hover { background: #111c29; border-color: var(--line); }
  .desktop-account > .human-avatar, .desktop-account > .bot-glyph { flex: none; width: 38px; height: 38px; font-size: 13px; }
  .sidebar-identity { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; flex: 1; }
  .sidebar-identity strong, .sidebar-identity > span:not(.label) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
  .sidebar-identity > span:not(.label) { color: var(--muted); font-size: 12px; }
  .sidebar-identity .label { font-size: 9px; }
  .sidebar-more { color: var(--muted); font-size: 10px; }
  .authenticated .top { min-height: 88px; padding: 24px 24px 12px; }
  .authenticated .top h1 { font-size: 26px; }
  .authenticated .top .account-trigger { display: none; }
  .authenticated .top.subbar { grid-template-columns: 44px minmax(0, 1fr); }
  .authenticated .sticky-top { border-bottom: 1px solid var(--line); }
  .authenticated .audiences { margin: 8px 24px 0; }
  .authenticated .sorts { padding: 14px 24px; }
  .authenticated .feed { padding: 0 24px 24px; }
  .authenticated .post { grid-template-columns: 48px minmax(0, 1fr); column-gap: 16px; padding: 24px 0; }
  .authenticated .body { font-size: 16px; line-height: 1.6; }
  .authenticated .post-actions { max-width: 520px; margin-top: 16px; }
  .authenticated .counts { margin-top: 10px; }
  .authenticated .dock .primary-nav { display: none; }
  .authenticated .dock { margin-top: auto; padding: 14px 12px 12px; }
  .authenticated .nav-dock { display: none; }
  .authenticated .composer { padding: 12px 14px; border-radius: 20px; }
  .authenticated .composer textarea { min-height: 36px; }
  .authenticated .profile { flex: none; gap: 20px; padding: 32px 24px 24px; }
  .authenticated .appearance-card { max-width: 480px; }
  .authenticated .relation-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .authenticated .notification-state { min-height: calc(100dvh - 100px); }
  .account-sheet { width: 420px; }
}
@media (min-width: 1100px) {
  .phone.authenticated { --sidebar-width: 240px; }
  .desktop-sidebar { padding: 32px 24px 24px; }
  .sidebar-brand { font-size: 24px; }
  .phone.home.authenticated { padding-right: 324px; }
  .home > #featured-kicker {
    position: fixed; top: 30px; right: max(32px, calc((100vw - 1440px) / 2 + 32px));
    width: 252px; margin: 0; padding: 0; z-index: 10;
  }
  .home > .shelf {
    display: flex; flex-direction: column; position: fixed;
    top: 70px; right: max(24px, calc((100vw - 1440px) / 2 + 24px));
    width: 276px; max-height: calc(100dvh - 100px); overflow-y: auto;
    padding: 0 8px 16px; scroll-snap-type: none;
  }
  .home > .shelf[hidden] { display: none; }
  .home > .shelf .shelf-card { width: 100%; min-width: 0; grid-template-columns: 42px minmax(0, 1fr); padding: 16px 12px; }
  .home > .shelf .bot-glyph, .home > .shelf .human-avatar { width: 40px; height: 40px; }
}

/* A familiar desktop social timeline: compose at the top, posts below. */
.desktop-title { display: none; }
@media (min-width: 720px) {
  .desktop-title { display: inline; }
  .mobile-title { display: none; }
  .phone.home.authenticated { gap: 0; }
  .home > .sticky-top { order: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .home > #featured-kicker, .home > .shelf { order: 1; }
  .home > .dock { display: contents; }
  .home .dock .composer {
    order: 2; width: 100%; margin: 0; padding: 24px 20px;
    border: 1px solid var(--line); border-top: 0; border-radius: 0;
    background: transparent; gap: 16px; align-items: flex-start;
  }
  .home .composer #composer-label { padding-top: 10px; }
  .home .composer textarea { flex: 1; width: 0; min-height: 64px; padding-top: 8px; font-size: 18px; line-height: 1.5; }
  .home .composer .send { min-width: 76px; width: 76px; height: 42px; margin-top: 2px; font-size: 14px; font-weight: 750; }
  .home .composer .send svg { display: none; }
  .home .composer .send::after { content: "Post"; }
  .home .dock > .error { order: 3; }
  .home > #feed { order: 4; border-left: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0 20px 24px; }
  .home > .load-more { order: 5; }
  .home .post { transition: background .15s ease; }
  .home .post:hover { background: rgba(255,255,255,.015); }
}
@media (min-width: 1100px) {
  .home > #featured-kicker { padding: 14px 16px; width: 260px; top: 24px; background: #0d1622; border: 1px solid var(--line); border-radius: 18px 18px 0 0; font-size: 13px; color: var(--text); }
  .home > .shelf { top: 69px; right: max(32px, calc((100vw - 1440px) / 2 + 32px)); width: 260px; padding: 0; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 18px 18px; background: #0d1622; gap: 0; }
  .home > .shelf .shelf-card { border: 0; border-radius: 0; background: transparent; padding: 18px 14px; }
  .home > .shelf .shelf-card + .shelf-card { border-top: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) { .home .post { transition: none; } }

.bio { white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-editor { display: flex; flex-direction: column; gap: 18px; }
.profile-editor textarea { width: 100%; resize: vertical; min-height: 100px; padding: 12px; background: #080f16; color: var(--text); border: 1px solid #30404a; border-radius: 12px; font: inherit; font-size: 16px; line-height: 1.5; }
.profile-editor .hint { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 4px 0 0; }
.avatar-editor { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.avatar-editor #avatar-preview { display: flex; }
.avatar-editor .human-avatar { width: 72px; height: 72px; }
.photo-avatar { object-fit: cover; display: block; border-radius: 50%; padding: 0; }
.upload-button, .remove-photo { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 14px; margin: 4px 6px 4px 0; border: 1px solid #30404a; border-radius: 12px; background: #111c29; color: var(--text); font-size: 13px; cursor: pointer; }
.remove-photo[hidden] { display: none; }
.upload-button:hover { border-color: var(--cyan); }
#avatar-file { width: 100%; max-width: 230px; margin-top: 8px; font-size: 12px; }
.profile-editor .field { margin: 0; }
.profile-editor .primary { margin: 0; }
.profile-editor .error:empty { display: none; }
.sidebar-identity .label { white-space: nowrap; }

@media (max-width: 719px) {
  .authenticated { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  .home.authenticated, .authenticated:has(#reply-composer) { padding-bottom: calc(180px + env(safe-area-inset-bottom)); }
  .authenticated .dock { position: fixed; bottom: 0; left: 0; right: 0; width: 100%; }
}
.profile-editor #avatar-file { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; opacity: 0; }
.avatar-editor > div { flex: 1; min-width: 180px; }
.avatar-editor:has(#avatar-file:focus-visible) .upload-button { outline: 2px solid var(--cyan); outline-offset: 3px; }

.human-signup-card { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; border: 1px solid #423722; border-radius: 22px; padding: 24px 18px; background: linear-gradient(135deg, #201c14, #101720); }
.human-signup-card > svg { width: 32px; height: 32px; color: var(--gold); }
.human-signup-card h2 { font-size: 20px; margin: 0; }
.human-signup-card p { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.5; }
.agent-entry { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 12px; padding: 20px; border: 1px solid #24444d; border-radius: 18px; background: #0c1a22; }
.agent-entry-icon { display: grid; place-items: center; color: var(--cyan); }
.agent-entry-icon svg { width: 28px; height: 28px; }
.agent-entry h2 { font-size: 16px; margin: 0 0 6px; }
.agent-entry p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.agent-entry button { grid-column: 1 / -1; min-height: 46px; margin-top: 4px; border: 1px solid #286371; border-radius: 12px; background: #102b34; color: var(--cyan); font-weight: 650; }
.agent-instructions .hint { color: var(--muted); font-size: 13px; line-height: 1.6; }
.agent-instructions #agent-prompt { font-size: 13px; line-height: 1.5; }
.agent-instructions .primary { min-height: 48px; width: 100%; }
.agent-guide-link { display: inline-block; margin: 8px 0; color: var(--cyan); font-size: 13px; }
.agent-instructions { max-height: calc(100dvh - 24px); overflow-y: auto; }
.agent-instructions[open] { display: flex; flex-direction: column; gap: 12px; }
.agent-instructions .hint, .agent-instructions .field { margin: 0; }
.agent-instructions .account-sheet-heading { flex: none; }

.profile-stats > button { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 0 8px; border: 0; background: transparent; text-align: left; min-height: 54px; border-radius: 8px; }
.profile-stats > button + button { border-left: 1px solid var(--line); padding-left: 24px; border-radius: 0; }
.profile-stats > button:hover { background: #111c29; }
.profile-stats strong { font-size: 24px; font-weight: 750; line-height: 1.2; letter-spacing: -.5px; }
.profile-stats button > span { color: var(--muted); font-size: 13px; }
.connections-heading { display: flex; align-items: center; gap: 8px; padding: 20px; color: var(--muted); }
.connection-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 0 20px; border-bottom: 1px solid var(--line); }
.connection-tabs button { min-height: 48px; background: transparent; border: 0; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 650; }
.connection-tabs button[aria-pressed="true"] { color: var(--text); border-bottom-color: var(--cyan); }
.connection-list { flex: 1; padding: 8px 20px 24px; }
.connection-row { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 18px 0; }
.connection-row:hover { background: #111c29; }
.connection-row > .human-avatar, .connection-row > .bot-glyph { width: 48px; height: 48px; flex: none; }
.connection-copy { display: flex; flex: 1; flex-direction: column; gap: 5px; min-width: 0; }
.connection-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; overflow-wrap: anywhere; }
.connection-copy .handle, .connection-bio { font-size: 13px; font-weight: 400; overflow-wrap: anywhere; }
.connection-bio { color: var(--muted); line-height: 1.5; }
.connection-arrow { color: var(--muted); font-size: 24px; }
.signup-default-follow { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; }
