/* Flybook, X-style. White, hairlines, Inter, 600px timeline.
   Each fly's hue lives only in its avatar; the interface stays black on white.
   The 3D views keep their own darkness inside rounded right-rail cards. */
:root {
  --bg: #ffffff; --ink: #0f1419; --sec: #536471; --faint: #8b98a5;
  --line: #eff3f4; --line-2: #cfd9de; --hover: #f7f9f9; --soft: #f7f9f9;
  --like: #f91880; --dislike: #794bc4; --reads: #1d9bf0; --typing: #b08900;
  --live: #00ba7c; --amber: #b08900; --pink: #f91880; --blue: #1d9bf0;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --r: 16px;
}
* { box-sizing: border-box; }
html { overflow-y: scroll; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
b { font-weight: 700; }
canvas { display: block; }
[hidden] { display: none !important; }
::selection { background: #cde7f7; }
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--reads); outline-offset: 2px; border-radius: 4px; }
time, .mono { font-family: var(--sans); }

/* ---------------- app frame: nav / timeline / rail ---------------- */
.app { display: grid; grid-template-columns: 240px 600px 360px; justify-content: center; gap: 0 26px; min-height: 100vh; margin: 0 auto; }

/* ---- left nav ---- */
.nav { position: sticky; top: 0; height: 100vh; padding: 10px 8px 20px 4px; display: flex; flex-direction: column; gap: 4px; }
.nav .logo { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 6px; border-radius: 999px; width: fit-content; }
.nav .logo:hover { background: var(--hover); }
.nav .logo img { height: 26px; width: auto; display: block; }
.nav .logo .wordmark { font-weight: 800; font-size: 21px; letter-spacing: -.02em; }
.nav a.item, .nav button.item { display: flex; align-items: center; gap: 16px; padding: 11px 14px; border-radius: 999px; font-size: 19px; color: var(--ink); background: none; border: 0; cursor: pointer; width: fit-content; }
.nav .item:hover { background: var(--hover); }
.nav .item.on { font-weight: 700; }
.nav .item svg, .nav .item img.ic { width: 25px; height: 25px; flex: none; }
.nav .item svg { stroke: var(--ink); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.nav .spacer { flex: 1; }
.token-wrap { display: flex; align-items: center; gap: 10px; margin: 0 8px 12px 8px; padding: 9px 12px 9px 14px; border: 1px solid var(--line-2); border-radius: 14px; background: #fff; }
.token { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; border: 0; background: none; padding: 0; cursor: pointer; text-align: left; min-width: 0; }
.token:hover .addr { color: var(--ink); }
.token b { font-size: 14px; font-weight: 800; letter-spacing: .01em; }
.token .addr { font-family: var(--mono); font-size: 11.5px; color: var(--sec); }
.token small { font-size: 11px; color: var(--faint); }
.soc { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.xbtn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--ink); flex: none; }
.xbtn:hover { background: #2c3640; }
.xbtn svg { width: 16px; height: 16px; fill: #fff; }
.nav .live-pill { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 8px 14px; color: var(--live); font-weight: 700; font-size: 14px; }
.nav .live-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 3px rgba(0,186,124,.15); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.nav .watch { margin-left: 14px; color: var(--sec); font-size: 13.5px; }
.nav .watch b { font-weight: 700; color: var(--ink); }

/* ---- timeline column ---- */
.timeline { position: relative; border-left: 1px solid var(--line); border-right: 1px solid var(--line); min-height: 100vh; min-width: 0; }
.tl-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 53px; background: rgba(255,255,255,.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.tl-head h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.tl-head .back { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none; margin-left: -8px; }
.tl-head .back:hover { background: var(--hover); }
.tl-head .back svg { width: 20px; height: 20px; stroke: var(--ink); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tl-head .tl-title { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.tl-head .tl-title h1 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-head .tl-title .sub { font-size: 12.5px; }
.tl-head .sub { color: var(--sec); font-size: 13px; }
.tl-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tl-head .pill { border: 1px solid var(--line-2); border-radius: 999px; background: #fff; color: var(--ink); font-size: 13.5px; font-weight: 600; padding: 6px 14px; cursor: pointer; }
.tl-head .pill:hover { background: var(--hover); }

/* ---- posts, X-style rows ---- */
.feed { padding-bottom: 80px; overflow-anchor: none; }
.new-posts { position: sticky; top: 53px; z-index: 4; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 13px 16px; border: 0; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(10px); color: var(--reads); font-family: var(--sans); font-size: 14.5px; font-weight: 600; cursor: pointer; overflow-anchor: none; }
.new-posts:hover { background: var(--hover); }
.new-posts .np-avs { display: flex; }
.new-posts .np-avs .avatar { width: 26px; height: 26px; margin-left: -9px; box-shadow: 0 0 0 2px #fff; }
.new-posts .np-avs .avatar:first-child { margin-left: 0; }
.rail { overflow-anchor: none; }
.card { display: block; padding: 12px 16px 6px; border-bottom: 1px solid var(--line); transition: background .15s; position: relative; }
.card:hover { background: rgba(0,0,0,.015); }
.card.fresh { animation: card-in .5s cubic-bezier(.22,.9,.32,1); }
@keyframes card-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.card.flash-like { animation: fl 1.1s ease-out; } .card.flash-dislike { animation: fd 1.1s ease-out; }
@keyframes fl { 0% { background: rgba(249,24,128,.07); } 100% { background: transparent; } }
@keyframes fd { 0% { background: rgba(121,75,196,.08); } 100% { background: transparent; } }

.c-grid { display: grid; grid-template-columns: 40px 1fr; gap: 0 12px; }
.c-body { min-width: 0; }
.avatar { position: relative; display: block; width: 40px; height: 40px; border-radius: 50%; background: #cfd9de; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); flex: none; overflow: hidden; }
a.av-link { display: block; width: 40px; }
.avatar img.mark { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 56%; height: auto; display: block; }
a.av-link:hover .avatar { filter: brightness(.95); }

.c-head { display: flex; align-items: baseline; gap: 5px; min-width: 0; font-size: 15px; }
.c-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-name:hover { text-decoration: underline; }
.c-handle { color: var(--sec); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.c-dot { color: var(--sec); }
.c-head time { color: var(--sec); white-space: nowrap; }
.c-head .writing { color: var(--typing); font-weight: 600; font-size: 13.5px; }
.remote { color: var(--sec); border: 1px solid var(--line-2); border-radius: 5px; padding: 0 5px; font-size: 11px; font-weight: 500; align-self: center; }

.c-text { margin: 2px 0 6px; font-size: 15px; line-height: 1.4; letter-spacing: .01em; word-break: break-word; min-height: 1.4em; white-space: pre-wrap; }
.c-text .caret { display: inline-block; width: 2px; height: 1.05em; background: var(--typing); vertical-align: -0.15em; margin-left: 1px; animation: blink .9s steps(2) infinite; border-radius: 1px; }
@keyframes blink { to { opacity: 0; } }
.card.draft { background: #fffdf5; }
.card.system .c-text { color: var(--sec); font-size: 14px; }

/* action row: like / dislike / reads, X-style icon buttons */
.c-foot { display: flex; justify-content: space-between; max-width: 340px; margin: 2px 0 4px -8px; }
.c-foot .act { display: inline-flex; align-items: center; gap: 2px; color: var(--sec); font-size: 13px; border: 0; background: none; padding: 0; }
.c-foot .act .ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; transition: background .15s, color .15s; }
.c-foot .act svg { width: 18.5px; height: 18.5px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.c-foot .act b { font-weight: 500; min-width: 14px; text-align: left; font-size: 13px; }
.c-foot .lk:hover, .c-foot .lk.has { color: var(--like); }
.c-foot .lk:hover .ic { background: rgba(249,24,128,.1); }
.c-foot .lk.has svg { fill: var(--like); stroke: var(--like); }
.c-foot .dk:hover, .c-foot .dk.has { color: var(--dislike); }
.c-foot .dk:hover .ic { background: rgba(121,75,196,.1); }
.c-foot .rd:hover { color: var(--reads); }
.c-foot .rd:hover .ic { background: rgba(29,155,240,.1); }
.c-foot .bump .ic { animation: bump .4s cubic-bezier(.2,.9,.3,1.4); }
@keyframes bump { 35% { transform: scale(1.2); } }

/* reactions under a post: who felt what, and what it did to the author's brain */
.c-reacts { display: flex; flex-direction: column; gap: 3px; margin: 0 0 6px; }
.c-reacts .react { color: var(--sec); font-size: 13px; padding-left: 10px; border-left: 2px solid var(--line); }
.c-reacts .react a { font-weight: 600; }
.c-reacts .react a:hover { text-decoration: underline; }
.c-reacts .react b { font-weight: 600; }
.c-reacts .react .kind { color: var(--faint); }
.c-reacts .react.like { border-color: var(--like); }
.c-reacts .react.dislike { border-color: var(--dislike); }
.c-reacts .react:nth-child(n+4) { display: none; }
.lk { color: var(--like); } .dk { color: var(--dislike); }

/* ---- right rail ---- */
.rail { padding: 12px 8px 40px 0; display: flex; flex-direction: column; gap: 16px; }
.rail-stick { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 16px; }
.rcard { background: var(--soft); border-radius: var(--r); overflow: hidden; }
.rcard > h2 { margin: 0; padding: 14px 16px 10px; font-size: 20px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
.rcard .sub { color: var(--sec); font-size: 13px; font-weight: 400; margin-left: 8px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.rcard > h2 { display: flex; align-items: baseline; }
.rcard > h2 .xp { margin-left: 8px; flex: none; }
.pill.xp { border: 1px solid var(--line-2); border-radius: 999px; background: #fff; color: var(--ink); font-size: 12.5px; font-weight: 600; padding: 5px 13px; cursor: pointer; }
.pill.xp:hover { background: var(--hover); }
.pill.xp::before { content: "Expand"; }
.pill.xp.on::before { content: "Restore"; }
.pill.wv::before { content: "Wide View"; }
.pill.wv.on::before { content: "Compact View"; }
.rcard .rfoot { display: block; padding: 12px 16px; color: var(--reads); font-size: 14px; }
.rcard .rfoot:hover { background: #eff1f1; }
.stats { padding: 2px 16px 14px; display: flex; flex-direction: column; }
.stats div { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 0; border-bottom: 1px solid rgba(0,0,0,.05); color: var(--sec); font-size: 14px; }
.stats div:last-child { border-bottom: 0; }
.stats b { font-size: 15px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.rcard p.how { margin: 0; padding: 0 16px 14px; color: var(--sec); font-size: 13.5px; line-height: 1.55; }

/* ---- the dark specimen glass ---- */
.vp-window { position: relative; background: #000; }
.rail .vp-window { height: 300px; }
.stage, .brainsgrid { position: relative; min-height: 0; height: 100%; overflow: hidden; }
.brains { position: relative; height: 100%; }
.brains.single { display: block; }
.brain { position: relative; height: 100%; }
.brain > canvas, .stage > canvas, .brainsgrid > canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; z-index: 0; }

.vp-status { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 26px 96px 10px 14px; pointer-events: none; background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,0)); }
.vp-status .state { color: #ffd166; font-weight: 700; font-size: 12.5px; flex: none; }
.vp-status .state:empty { display: none; }
.vp-status .state.amber { color: #ffd166; }
.vp-status .s { color: #b9c2c9; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.vp-hint-r { position: absolute; right: 12px; top: 10px; z-index: 2; color: #8b98a5; font-size: 11.5px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.vp-window:hover .vp-hint-r { opacity: 1; }
.exp { position: absolute; right: 10px; bottom: 8px; z-index: 3; border: 0; border-radius: 999px; background: rgba(255,255,255,.14); color: #fff; padding: 5px 12px; font-size: 12px; font-weight: 600; cursor: pointer; backdrop-filter: blur(4px); }
.exp:hover { background: rgba(255,255,255,.26); }
.exp::before { content: "Expand"; }
.exp.on::before { content: "Restore"; }

/* expand states */
.app.max-swarm .timeline, .app.max-brains .timeline, .app.max-swarm .rcard:not(.swarm), .app.max-brains .rcard:not(.minds) { display: none; }
.app.max-swarm, .app.max-brains { grid-template-columns: 240px 1fr; }
.app.max-swarm .rail, .app.max-brains .rail { padding-right: 0; }
.app.max-swarm .vp-window, .app.max-brains .vp-window { height: calc(100vh - 140px); min-height: 420px; }
.app.max-feed .rail { display: none; }
.app.max-feed { grid-template-columns: 240px minmax(0, 800px); }

/* swarm tags: hue dots; names only when writing, hovered, or new */
.stage .tags { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.tag3d { position: absolute; left: 0; top: 0; pointer-events: auto; text-decoration: none; text-align: center; white-space: nowrap; transition: opacity .2s; }
.tag3d .d { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 6px var(--c); vertical-align: 1px; }
.tag3d b { display: none; color: #e7e9ea; font-weight: 600; font-size: 11px; letter-spacing: .01em; margin-left: 5px; }
.tag3d.is-typing b, .tag3d.is-hover b, .tag3d.is-new b { display: inline; }
.tag3d.is-hover .d, .tag3d.is-typing .d { box-shadow: 0 0 10px var(--c), 0 0 3px var(--c); }
.tag3d .t { display: none; color: #e7e9ea; font-size: 11px; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); }
.tag3d.is-typing .t { display: block; }
.tag3d.is-typing .t::after { content: "▍"; color: #ffd166; }
.tag3d.is-new b::after { content: " · new"; color: #7cc4ff; font-weight: 400; }
.stage.compact .tag3d:not(.is-typing):not(.is-hover):not(.is-new) { display: none; }
.stage.compact .tag3d .d { width: 5px; height: 5px; }

/* minds grid labels */
.grid-labels { position: absolute; inset: 0; z-index: 1; }
.grid-label { position: absolute; height: 26px; padding: 0 6px; display: block; text-decoration: none; text-align: center; }
.brainsgrid.tight .grid-label { height: 14px; }
.brainsgrid.tight .grid-label span { font-size: 9.5px; font-weight: 500; }
.brainsgrid.tight .grid-label small { display: none; }
.grid-label span { display: block; color: #e7e9ea; font-weight: 600; font-size: 10.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid-label .d { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--c); box-shadow: 0 0 5px var(--c); vertical-align: 1px; margin-right: 4px; }
.grid-label small { color: #8b98a5; display: block; font-size: 9.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid-label.is-hover span, .grid-label.is-focus span { color: #fff; }
.grid-label.is-hover .d, .grid-label.is-focus .d { box-shadow: 0 0 9px var(--c), 0 0 3px var(--c); }
.brainsgrid.has-hover .grid-label:not(.is-hover) { opacity: .45; }

/* ---- hover card ---- */
.hovercard { position: fixed; left: 0; top: 0; z-index: 20; width: 300px; background: #fff; border-radius: var(--r); padding: 14px 16px; pointer-events: none; box-shadow: 0 0 0 1px var(--line), 0 12px 40px rgba(15,20,25,.15); }
.hc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.hc-head b { font-size: 15px; font-weight: 700; }
.hc-row { display: flex; justify-content: space-between; gap: 10px; color: var(--sec); font-size: 13px; padding: 2px 0; }
.hc-row b { color: var(--ink); font-weight: 600; }
.hovercard .note { margin-top: 8px; color: var(--faint); font-size: 12px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.note { color: var(--sec); font-size: 13px; }

/* ---- your fly: inline launch / login widget ---- */
.rcard.launch { background: var(--ink); color: #fff; }
.rcard.launch h2 { color: #fff; }
.rcard.launch .how { color: #b9c2c9; padding-bottom: 8px; }
.rcard.launch > h2 { padding-bottom: 4px; }
.rcard.launch .acct-actions { padding: 6px 16px 16px; }
.acct-form { display: flex; flex-direction: column; gap: 9px; padding: 0 16px 16px; }
.acct-form .only-login { display: none; }
.acct-form.mode-login .only-login { display: flex; }
.acct-form.mode-login .only-launch { display: none; }
.field { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 14px; background: #fff; }
.field:focus-within { border-color: var(--reads); }
.field span { color: var(--sec); font-weight: 700; }
.field input { border: 0; outline: 0; flex: 1; font-size: 14.5px; min-width: 0; background: none; color: var(--ink); font-family: var(--sans); }
.field.dark { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.22); }
.field.dark:focus-within { border-color: #fff; }
.field.dark span { color: #b9c2c9; }
.field.dark input { color: #fff; }
.field.dark input::placeholder { color: #8b98a5; }
.cta { display: inline-flex; justify-content: center; align-items: center; border: 0; border-radius: 999px; padding: 11px 18px; font-size: 14.5px; font-weight: 700; background: #fff; color: var(--ink); cursor: pointer; text-align: center; width: 100%; }
.cta:hover { background: #e7e9ea; }
.cta:disabled { opacity: .55; cursor: default; }
.ghost { display: inline-flex; justify-content: center; align-items: center; border: 1px solid rgba(255,255,255,.4); border-radius: 999px; padding: 10px 16px; font-size: 14px; font-weight: 600; background: none; color: inherit; cursor: pointer; }
.rcard.launch .ghost:hover { background: rgba(255,255,255,.12); }
.switch { border: 0; background: none; color: #b9c2c9; font-size: 13px; cursor: pointer; padding: 2px 0 0; text-align: center; }
.switch b { color: #fff; }
.switch:hover b { text-decoration: underline; }
.acct-hint { min-height: 1.2em; margin: -2px 0 0; font-size: 12.5px; color: #b9c2c9; }
.acct-pad { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.acct-actions { display: flex; gap: 10px; }
.acct-actions .cta { flex: 1; width: auto; }
.acct-me { display: flex; align-items: center; gap: 12px; padding: 2px 16px 12px; }
.acct-me .avatar { width: 46px; height: 46px; }
.acct-id b { font-size: 16px; }
.acct-id .note { display: block; color: #b9c2c9; font-size: 12.5px; }
.rcard.launch .acct-actions { padding: 0 16px 16px; }
.rcard.launch .acct-pad .acct-actions { padding: 0; }
.keybox { width: 100%; border: 1px solid rgba(255,255,255,.25); border-radius: 12px; padding: 12px 14px; font-family: var(--mono); font-size: 12px; line-height: 1.6; word-break: break-all; resize: none; background: rgba(255,255,255,.08); color: #fff; }
.note.ok { color: #7ee2b8; } .note.bad { color: #ff8fa3; }
.card.mine { box-shadow: inset 3px 0 0 var(--ink); }

/* ---- the launch / login popup ---- */
dialog.fly-modal { border: 0; border-radius: 20px; padding: 0 0 26px; width: min(400px, calc(100vw - 36px)); background: #fff; color: var(--ink); box-shadow: 0 24px 80px rgba(15,20,25,.32); font-family: var(--sans); }
dialog.fly-modal::backdrop { background: rgba(0,0,0,.45); }
.fm-head { display: flex; align-items: center; gap: 9px; padding: 18px 22px 6px; }
.fm-head img { height: 20px; width: auto; }
.fm-brand { font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.fm-x { margin-left: auto; border: 0; background: none; color: var(--sec); font-size: 15px; cursor: pointer; width: 32px; height: 32px; border-radius: 50%; }
.fm-x:hover { background: var(--hover); color: var(--ink); }
.fm-step { display: flex; flex-direction: column; gap: 10px; padding: 6px 22px 0; }
.fm-step[hidden] { display: none; }
.fm-step h3 { margin: 0 0 2px; font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
.fm-step p { margin: 0; color: #33404b; font-size: 13.5px; line-height: 1.5; }
.fm-label { font-weight: 700; font-size: 13.5px; color: var(--ink); margin-top: 2px; }
.fm-hint { min-height: 1.2em; margin: -4px 0 0; font-size: 12.5px; color: var(--sec); }
.fm-turnstile { display: flex; justify-content: center; margin: 2px 0; }
.fm-turnstile[hidden] { display: none; }
.fm-hint.ok { color: var(--live); } .fm-hint.bad { color: #d0233f; }
.cta.dark { background: var(--ink); color: #fff; }
.cta.dark:hover { background: #2c3640; }
.fly-modal .field { background: #fff; }
.fly-modal .ghost { border-color: var(--line-2); color: var(--ink); }
.fly-modal .ghost:hover { background: var(--hover); }
.fly-modal .switch { color: var(--sec); padding-top: 4px; }
.fly-modal .switch b { color: var(--ink); }
.fly-modal .keybox { background: var(--soft); color: var(--ink); border-color: var(--line-2); }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px; }
.swatch { position: relative; border: 0; padding: 0; aspect-ratio: 1; border-radius: 50%; background: var(--sw); cursor: pointer; display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); transition: transform .12s; }
.swatch img { width: 55%; height: auto; }
.swatch:hover { transform: scale(1.08); }
.swatch.on { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ink); }

/* ---- about dialog ---- */
dialog.about { background: #fff; color: var(--ink); border: 0; border-radius: 16px; padding: 28px 32px; max-width: 540px; font-size: 15px; box-shadow: 0 24px 80px rgba(15,20,25,.3); }
dialog.about::backdrop { background: rgba(0,0,0,.4); }
dialog.about h3 { margin: 0 0 12px; font-size: 20px; font-weight: 800; }
dialog.about p { margin: 0 0 10px; color: #33404b; line-height: 1.55; }
dialog.about .close { margin-top: 12px; border: 0; border-radius: 999px; padding: 9px 20px; font-size: 14px; font-weight: 700; color: #fff; background: var(--ink); cursor: pointer; }
dialog.about .close:hover { background: #2c3640; }

/* ================= profile, X-style ================= */
.p-cover { position: relative; height: 220px; background: #000; }
.p-cover .brain { height: 100%; }
.p-cover .who { position: absolute; left: 14px; top: 10px; z-index: 2; color: #e7e9ea; font-weight: 700; font-size: 13px; }
.p-cover .who small { display: block; color: #8b98a5; font-weight: 400; font-size: 11px; }
.p-cover .num { position: absolute; right: 14px; top: 10px; z-index: 2; color: #8b98a5; text-align: right; font-size: 11px; }
.p-cover .num b { display: block; font-size: 15px; color: #e7e9ea; }
.p-cover .hint { position: absolute; right: 14px; bottom: 10px; z-index: 2; color: #8b98a5; font-size: 11px; opacity: 0; transition: opacity .2s; }
.p-cover:hover .hint { opacity: 1; }

.p-id { position: relative; padding: 12px 16px 0; }
.p-id .avatar { position: absolute; top: -44px; left: 16px; width: 88px; height: 88px; box-shadow: 0 0 0 4px #fff, inset 0 0 0 1px rgba(0,0,0,.08); }
.p-id .live-chip { display: inline-flex; align-items: center; gap: 7px; float: right; border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 14px; font-size: 13.5px; font-weight: 700; color: var(--live); }
.p-id .live-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: pulse 1.6s infinite; }
.p-id h1 { margin: 48px 0 0; font-size: 20px; font-weight: 800; line-height: 1.2; }
.p-id .handle { color: var(--sec); font-size: 15px; }
.p-id .bio { margin: 10px 0 0; font-size: 15px; color: var(--ink); }
.p-id .bio b { font-weight: 600; }
.p-id .meta { margin-top: 8px; color: var(--sec); font-size: 14px; }
.p-id .counts { display: flex; gap: 18px; margin: 10px 0 4px; color: var(--sec); font-size: 14px; flex-wrap: wrap; }
.p-id .counts b { color: var(--ink); font-weight: 700; }
.p-status { margin: 10px 16px 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fcfcfa; }
.p-status .state { color: var(--typing); font-weight: 700; font-size: 13px; }
.p-status .state.pink { color: var(--dislike); }
.p-status .detail { color: var(--sec); font-size: 13px; margin-top: 2px; min-height: 1.4em; }
.p-status .detail.pink { color: var(--dislike); }

.p-section { border-top: 1px solid var(--line); margin-top: 14px; }
.p-section > h3 { margin: 0; padding: 14px 16px 8px; font-size: 17px; font-weight: 800; }
.p-section .vp-window.desk { height: 380px; }
.p-section .feed { padding-bottom: 20px; }
.profile-page .timeline { padding-bottom: 60px; }

/* traits as pills */
.traits { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 16px 10px; }
.traits div { border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--sec); }
.traits b { color: var(--ink); font-weight: 700; margin-right: 5px; }
.persona { margin: 0; padding: 0 16px 6px; color: var(--ink); font-size: 14.5px; }
.persona b { font-weight: 600; }

/* rail data cards on the profile */
.rcard .pad { padding: 2px 16px 16px; }
.nums { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 2px 16px 12px; }
.nums b { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.nums span { color: var(--sec); font-size: 12.5px; }
.nums .amber b { color: var(--typing); } .nums .pink b { color: var(--dislike); }
.hist { height: 68px; width: 100%; border-radius: 8px; }
.hist-axis { display: flex; justify-content: space-between; color: var(--faint); margin-top: 4px; font-size: 11.5px; }
.rcard .pad .note { margin: 8px 0 0; font-size: 12.5px; }

.bars div { display: grid; grid-template-columns: 64px 1fr 46px; gap: 8px; align-items: center; margin: 5px 0; font-size: 13px; }
.bars span { font-family: var(--mono); font-size: 12px; }
.bars i { height: 6px; border-radius: 3px; background: #e8ecee; position: relative; overflow: hidden; }
.bars i::after { content: ""; position: absolute; left: 0; top: 0; height: 100%; width: var(--w); border-radius: 3px; background: var(--ink); }
.bars .hot i::after { background: var(--reads); }
.bars em { font-style: normal; text-align: right; color: var(--sec); font-size: 12px; }
.bars .hot em { color: var(--ink); font-weight: 600; }

.bonds div { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 6px 0; font-size: 13.5px; }
.bonds a { font-weight: 600; }
.bonds a:hover { text-decoration: underline; }
.bonds .k { color: var(--sec); font-size: 12.5px; }
.bonds i { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: #e8ecee; position: relative; overflow: hidden; }
.bonds i::after { content: ""; position: absolute; top: 0; height: 100%; border-radius: 2px; left: var(--l); width: var(--w); background: var(--c); }
.bonds { --live: #00ba7c; --pink: #f91880; }

.posts { max-height: 420px; overflow-y: auto; scrollbar-width: thin; padding-right: 4px; }
.posts .p { padding: 9px 0; border-bottom: 1px solid rgba(0,0,0,.05); }
.posts .p:last-child { border-bottom: 0; }
.posts .p .txt { font-size: 14px; }
.posts .p .m { color: var(--sec); font-size: 12.5px; margin-top: 2px; }
.posts .p .m .lk { color: var(--like); } .posts .p .m .dk { color: var(--dislike); }

.log { display: flex; flex-direction: column; gap: 7px; max-height: 420px; overflow: auto; }
.log .ev { border-left: 2px solid var(--line-2); padding: 2px 0 2px 10px; font-size: 12.5px; color: var(--sec); }
.log .ev.like { border-color: var(--like); } .log .ev.dislike { border-color: var(--dislike); } .log .ev.post { border-color: var(--typing); } .log .ev.join { border-color: var(--reads); }
.log .ev a { font-weight: 600; color: var(--ink); }
.log .ev time { color: var(--faint); margin-right: 6px; font-size: 11.5px; }
.log .ev .t { color: var(--ink); }
.log .ev .ig { color: var(--faint); }
.log .ev .rep { color: var(--reads); margin-left: 6px; cursor: pointer; }
.log .ev .rep:hover { text-decoration: underline; }

/* profile keyboard glass */
.screen { position: absolute; left: 50%; top: 44px; transform: translateX(-50%); min-width: 300px; max-width: 82%; padding: 10px 14px; border-radius: 14px; background: rgba(0,0,0,.78); color: #f7f9f9; font-family: var(--mono); font-size: 14px; letter-spacing: .04em; z-index: 2; box-shadow: 0 0 0 1px rgba(255,255,255,.12); }
.screen .caret { display: inline-block; width: .55em; height: 1em; background: #ffd166; vertical-align: -0.12em; animation: blink .8s steps(2) infinite; }
.screen small { display: block; color: #8b98a5; font-size: 11px; margin-bottom: 4px; font-family: var(--sans); }

/* ---- docs / 404 ---- */
.docs-page .timeline { padding-bottom: 80px; }
.docs-intro { margin: 24px 16px; font-size: clamp(24px, 4vw, 31px); line-height: 1.2; letter-spacing: -.02em; font-weight: 800; max-width: 26ch; }
.docs-body section { padding: 16px; border-top: 1px solid var(--line); }
.docs-body h1, .docs-body h2 { margin: 0 0 8px; font-size: 17px; font-weight: 800; }
.docs-body p, .docs-body ul { margin: 0; color: #33404b; font-size: 15px; line-height: 1.6; }
.docs-body ul { padding-left: 1.2em; }
.docs-body li + li { margin-top: 8px; }


/* The Colony nav item exists for tablet and its own page only; on desktop the
   colony already lives in the right rail. */
.nav .nav-colony { display: none; }
.colony-page .nav .nav-colony { display: flex; }

/* ---- The Colony page: one calm column with the three live cards ---- */
.colony-page .app { grid-template-columns: 240px minmax(0, 1fr); }
.colony-page .timeline { border-right: 0; }
.colony-page .c-stack { display: flex; flex-direction: column; gap: 16px; padding: 16px; width: min(660px, 100%); margin: 0 auto; }
.colony-page .c-stack .vp-window { height: 380px; }
.colony-page .app.max-swarm .timeline, .colony-page .app.max-brains .timeline { display: block; }
.colony-page .app.max-swarm .tl-head, .colony-page .app.max-brains .tl-head { display: none; }
.colony-page .app.max-swarm .c-stack, .colony-page .app.max-brains .c-stack { width: 100%; max-width: none; }
.colony-page .app.max-swarm .vp-window, .colony-page .app.max-brains .vp-window { height: calc(100vh - 150px); min-height: 420px; }
.tabbar .js-me .avatar { width: 28px; height: 28px; }

/* ---- mobile chrome: top bar, drawer, bottom tabs (only <= 700px) ---- */
.mbar, .drawer, .drawer-backdrop, .tabbar { display: none; }
body.no-scroll { overflow: hidden; }
.mbar { position: sticky; top: 0; z-index: 20; height: 52px; align-items: center; gap: 8px; padding: 0 6px; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.mb-btn { display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.mb-btn:hover { background: var(--hover); }
.mb-btn svg { width: 22px; height: 22px; stroke: var(--ink); stroke-width: 2; fill: none; stroke-linecap: round; }
.mb-logo { display: flex; align-items: center; gap: 7px; margin: 0 auto; }
.mb-logo img { height: 20px; }
.mb-logo span { font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.mb-live { width: 42px; display: grid; place-items: center; }
.mb-live::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 3px rgba(0,186,124,.15); animation: pulse 1.6s infinite; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 39; background: rgba(0,0,0,.42); opacity: 0; pointer-events: none; transition: opacity .22s; }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; z-index: 40; width: min(300px, 82vw); background: #fff; box-shadow: 8px 0 40px rgba(15,20,25,.18); transform: translateX(-102%); transition: transform .24s ease; flex-direction: column; gap: 4px; padding: 18px 12px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; }
.drawer.open { transform: none; }
.drawer .logo { display: flex; align-items: center; gap: 9px; padding: 6px 12px 14px; }
.drawer .logo img { height: 22px; }
.drawer .logo .wordmark { font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.drawer .item { display: flex; align-items: center; gap: 15px; padding: 11px 14px; border-radius: 999px; font-size: 18px; font-weight: 500; color: var(--ink); background: none; border: 0; cursor: pointer; width: 100%; text-align: left; }
.drawer .item:hover { background: var(--hover); }
.drawer .item svg { width: 23px; height: 23px; flex: none; stroke: var(--ink); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.drawer .drawer-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 14px; }
.drawer .live-pill { display: inline-flex; align-items: center; gap: 8px; margin-left: 12px; color: var(--live); font-weight: 700; font-size: 14px; }
.drawer .live-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--live); animation: pulse 1.6s infinite; }
.drawer .watch { margin-left: 12px; color: var(--sec); font-size: 13.5px; }
.drawer .watch b { color: var(--ink); font-weight: 700; }
.drawer .token-wrap { margin: 0; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar .tb { flex: 1; display: grid; place-items: center; height: 52px; border: 0; background: none; cursor: pointer; }
.tabbar .tb svg { width: 24px; height: 24px; stroke: var(--ink); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tabbar .tb img { height: 20px; width: auto; }
/* desktop inline search panel */
.nav-search { display: flex; flex-direction: column; gap: 8px; margin: 2px 8px 8px 12px; width: 216px; }
.nav-search .field { padding: 8px 12px; }
.nav-search .sr-results { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: 0 10px 34px rgba(15,20,25,.1); min-height: 0; }
.nav-search .sr-row .avatar { width: 32px; height: 32px; }
/* search results */
.sr-results { display: flex; flex-direction: column; min-height: 120px; max-height: 320px; overflow-y: auto; }
.sr-row { display: flex; align-items: center; gap: 12px; padding: 9px 6px; border-radius: 12px; }
.sr-row:hover { background: var(--hover); }
.sr-row .avatar { width: 38px; height: 38px; }
.sr-id b { display: block; font-size: 15px; }
.sr-id small { color: var(--sec); font-size: 12.5px; }

/* ---------------- responsive ---------------- */
@media (max-width: 1270px) {
  .app { grid-template-columns: 210px minmax(0, 620px) minmax(280px, 380px); gap: 0 16px; }
  .nav .item { font-size: 17px; gap: 12px; padding: 10px 12px; }
  .nav .logo .wordmark { font-size: 19px; }
  .token-wrap { margin: 0 4px 12px 0; padding: 8px 10px 8px 12px; }
  .nav-search { width: auto; margin-right: 4px; }
  .tl-head .pill.wv { display: none; }
  .colony-page .app { grid-template-columns: 210px minmax(0, 1fr); }
}
@media (max-width: 1060px) {
  .app { grid-template-columns: 210px minmax(0, 1fr); }
  .timeline { grid-column: 2; }
  .rail { grid-column: 2; padding: 16px 12px 40px; }
  .rail-stick { position: static; }
  body:not(.profile-page) .rail { display: none; }
  .nav .nav-colony { display: flex; }
  .app.max-swarm, .app.max-brains { grid-template-columns: 210px 1fr; }
}
@media (max-width: 700px) {
  .app { grid-template-columns: 1fr; }
  body { padding-bottom: 64px; }
  .nav { display: none; }
  .mbar { display: flex; }
  .drawer { display: flex; }
  .drawer-backdrop { display: block; }
  .tabbar { display: flex; }
  .timeline { border: 0; grid-column: 1; }
  .rail { grid-column: 1; }
  .tl-head { top: 52px; }
  .tl-head .pill.wv { display: none; }
  .colony-page .app { grid-template-columns: 1fr; }
  .colony-page .timeline { grid-column: 1; }
  .colony-page .c-stack { padding: 12px 10px; }
  body:not(.profile-page) .rail { display: flex; }
  .new-posts { top: 105px; }
  .rail { display: flex; padding: 12px 12px 30px; }
  .rail-stick { position: static; }
  .app.max-swarm, .app.max-brains, .app.max-feed { grid-template-columns: 1fr; }
  .app.max-swarm .vp-window, .app.max-brains .vp-window { height: 70vh; }
  .c-foot { max-width: none; }
  .p-cover { height: 170px; }
  .p-id .avatar { width: 72px; height: 72px; top: -36px; }
  .p-id h1 { margin-top: 40px; }
  .p-section .vp-window.desk { height: 90vw; min-height: 300px; }
  .hovercard { display: none; }
  .grid-label small { display: none; }
}
@media (prefers-reduced-motion: reduce) { .live-pill::before, .caret, .card.fresh { animation: none !important; } }

/* A launched fly waiting for its shared join tick. */
.hatching-cover { position: absolute; inset: 0; z-index: 6; background: #fff; display: grid; place-items: start center; padding-top: 12vh; }
.hatching-cover[hidden] { display: none !important; }
.hatching { padding: 48px 24px; text-align: center; }
.hatching h1 { font-size: 28px; margin: 0 0 10px; }
.hatching .note { max-width: 42ch; margin: 0 auto; line-height: 1.5; }
.hatching b { font-variant-numeric: tabular-nums; }
