
:root { --radius:12px; --radius-s:8px; --paper:#f5f3ec; --card:#fbfaf3; --ink:#1f231c; --muted:#6b7060; --rule:rgba(31,35,28,.12); --tint:rgba(31,35,28,.05); --sidebar:#efede4;
  --live:#3d5233; --live-bg:#e3ead9; --warn:#8a6d1f; --warn-bg:#f1e9cf; --stop:#9c3f2b; --stop-bg:#f3e1db; --orange:#d9571f; --orange-ink:#fbf6ee;
  --mono:"IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace; --ease:cubic-bezier(.215,.61,.355,1); }
@media (prefers-color-scheme: dark) { :root { --paper:#191b16; --card:#1f231c; --ink:#ece9dd; --muted:#9a9e8f; --rule:rgba(236,233,221,.14); --tint:rgba(236,233,221,.06); --sidebar:#15170f;
  --live:#b9cfa8; --live-bg:#2b3a25; --warn:#e0c26a; --warn-bg:#3a3118; --stop:#d9846e; --stop-bg:#40241d; } }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
html { scroll-behavior:smooth; scroll-padding-top:72px; }
body { margin:0; background:var(--paper); color:var(--ink); font: 300 15px/1.55 "IBM Plex Sans", -apple-system, "Helvetica Neue", Arial, sans-serif; }
h1, h2, h3 { margin:0; font-weight:500; line-height:1.2; letter-spacing:-.01em; }
p { margin:6px 0; }
a { color:inherit; text-decoration:underline; text-underline-offset:3px; text-decoration-color:var(--muted); }
a:hover { text-decoration-color:var(--ink); }
.muted { color:var(--muted); } .small { font-size:.8rem; } .num { font-family:var(--mono); font-variant-numeric:tabular-nums; }
.eyebrow { font-size:.72rem; text-transform:uppercase; letter-spacing:.12em; color:var(--muted); margin:0 0 4px; font-weight:400; }
code { font-family:var(--mono); font-size:.85em; background:var(--tint); padding:.05em .35em; border-radius:4px; }
button { font:inherit; font-weight:400; border-radius:999px; padding:7px 16px; border:1px solid var(--ink); background:var(--ink); color:var(--paper); cursor:pointer; transition: background .2s var(--ease), opacity .2s var(--ease); }
button:hover { opacity:.88; }
button.quiet { background:transparent; color:var(--ink); border-color:var(--rule); } button.quiet:hover { background:var(--tint); opacity:1; }
button.danger { background:transparent; color:var(--stop); border-color:var(--stop); }
button.tiny { padding:2px 10px; font-size:.75rem; }
button[disabled] { opacity:.5; cursor:default; }
button:focus-visible, input:focus-visible, a:focus-visible { outline:2px solid var(--orange); outline-offset:2px; }
input { font:inherit; padding:8px 11px; border:1px solid var(--rule); border-radius:8px; background:var(--card); color:var(--ink); min-width:0; }
/* header bar */
.topbar { position:sticky; top:0; z-index:40; height:56px; display:flex; align-items:center; gap:18px; padding:0 20px; background:color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter:blur(10px); border-bottom:1px solid var(--rule); }
.topbar .spacer { flex:1; }
.topbar nav { display:flex; gap:4px; align-items:center; }
.topbar nav a, .topbar nav .handle { text-decoration:none; padding:6px 10px; border-radius:8px; font-size:.9rem; color:var(--ink); }
.topbar nav a:hover { background:var(--tint); }
.topbar nav a.ext::after { content:" ↗"; color:var(--muted); font-size:.8em; }
.topbar .handle { font-family:var(--mono); font-size:.85rem; color:var(--muted); }
.brand { display:inline-flex; align-items:center; gap:8px; text-decoration:none; white-space:nowrap; }
.brand .tile { display:inline-flex; width:28px; height:28px; border-radius:7px; align-items:center; justify-content:center; }
.brand .tile svg { width:18px; height:18px; }
.brand .tile-commons { background:var(--orange); color:var(--orange-ink); margin-right:-2px; }
.brand .tile-cursor { background:var(--ink); color:var(--paper); }
.brand .wordmark { font-weight:500; font-size:1.02rem; letter-spacing:-.01em; margin-left:4px; }
.brand .wm-x { color:var(--muted); font-weight:300; margin:0 2px; }
/* status pill with spinner */
.pill { display:inline-flex; align-items:center; gap:7px; font-family:var(--mono); font-size:.72rem; padding:3px 11px; border-radius:999px; background:var(--tint); color:var(--muted); white-space:nowrap; }
.pill.live, .pill.running { background:var(--live-bg); color:var(--live); }
.pill.stopped, .pill.failed { background:var(--stop-bg); color:var(--stop); }
.pill.warn, .pill.setup, .pill.ready, .pill.creating { background:var(--warn-bg); color:var(--warn); }
.spin { display:inline-block; width:11px; height:11px; border-radius:50%; border:1.5px solid currentColor; border-top-color:transparent; animation: spin .8s linear infinite; flex:none; }
.dot { display:inline-block; width:8px; height:8px; border-radius:50%; background:currentColor; flex:none; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity:1 } 50% { opacity:.45 } }
@media (prefers-reduced-motion: reduce) { .spin { animation:none; border-top-color:currentColor; opacity:.6; } html { scroll-behavior:auto; } }

.avatar { display:inline-block; vertical-align:middle; flex:none; }
.avatar .flag { transform-origin: 22px 42px; }
.avatar.live .flag { animation: flutter 1.8s ease-in-out infinite; }
@keyframes flutter { 0%, 100% { transform: skewY(0deg) scaleX(1); } 30% { transform: skewY(-3deg) scaleX(.985); } 60% { transform: skewY(2deg) scaleX(.995); } }
@media (prefers-reduced-motion: reduce) { .avatar.live .flag { animation: none; } }
.avatar-pick { display:grid; grid-template-columns: repeat(9, 40px); gap:8px; }
.avatar-pick button { padding:2px; border-radius:10px; background:transparent; border:2px solid transparent; line-height:0; }
.avatar-pick button.on { border-color:var(--ink); }

.side-head { display:flex; gap:12px; align-items:flex-start; }
.side-head .avatar-slot:empty { display:none; }
.crumb .avatar { margin-right:6px; }
.crumb { display:inline-flex; align-items:center; gap:10px; font-size:.95rem; }
.crumb-sep { color:var(--muted); font-weight:300; }
#space-crumb { font-weight:500; }
.shell { display:grid; grid-template-columns: 232px minmax(0, 1fr); gap:0; max-width:1360px; margin:0 auto; }
.side { position:sticky; top:56px; height:calc(100vh - 56px); overflow:auto; padding:22px 18px 22px 22px; border-right:1px solid var(--rule); background:var(--sidebar); display:flex; flex-direction:column; gap:18px; }
.side-head h1 { font-size:1.25rem; margin-top:2px; word-break:break-word; }
.side-meta { font-size:.75rem; color:var(--muted); margin-top:4px; font-family:var(--mono); overflow-wrap:anywhere; }
.side-foot { overflow-wrap:anywhere; line-height:1.5; }
.side-nav { display:flex; flex-direction:column; gap:2px; }
.side-nav a { display:flex; justify-content:space-between; align-items:center; text-decoration:none; padding:7px 10px; border-radius:var(--radius-s); font-size:.92rem; color:var(--ink); transition: background .2s var(--ease); }
.side-nav a:hover { background:var(--tint); }
.side-nav a.active { background:var(--card); box-shadow: inset 2px 0 0 var(--orange); font-weight:500; }
.side-nav .count { font-family:var(--mono); font-size:.72rem; color:var(--muted); background:var(--tint); padding:1px 7px; border-radius:999px; }
.side-actions { display:flex; flex-direction:column; gap:6px; }
.side-actions button { width:100%; }
.side-foot { margin-top:auto; }
.content { padding: 26px 32px 96px; min-width:0; }
.section { padding-top:26px; margin-top:26px; border-top:1px solid var(--rule); scroll-margin-top:72px; }
.section:first-child { padding-top:0; margin-top:0; border-top:0; }
.status { margin-top:0; font-size:1.05rem; display:flex; align-items:center; gap:10px; }
.status.busy::before { content:""; display:inline-block; width:8px; height:8px; border-radius:50%; background:var(--live); animation: pulse 1.6s ease-in-out infinite; flex:none; }
.stats { display:grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap:12px; margin-top:22px; }
.stats article { border-top:1px solid var(--rule); padding-top:8px; }
.stats .meter { height:4px; background:var(--tint); border-radius:999px; margin-top:8px; overflow:hidden; }
.stats .meter i { display:block; height:100%; width:0; background:var(--ink); border-radius:999px; transition:width .4s ease; }
.stats .meter i.warn { background:var(--warn, #b45309); } .stats .meter i.full { background:var(--stop, #b91c1c); }
.stats em { display:block; font-style:normal; margin-top:6px; line-height:1.3; }
.stats strong small { font-size:.7rem; font-weight:400; }
.stats span { display:block; font-size:.72rem; color:var(--muted); text-transform:uppercase; letter-spacing:.08em; }
.stats strong { display:block; font-weight:500; font-size:1.2rem; margin-top:2px; }
.banner { margin-top:16px; padding:10px 14px; border-radius:var(--radius-s); background:var(--warn-bg); color:var(--warn); }
.heading { display:flex; align-items:baseline; gap:12px; margin-bottom:12px; flex-wrap:wrap; }
.heading .eyebrow { margin:0; } h2 { font-size:1.05rem; }
.cards { display:grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap:16px; }
.card { background:var(--card); border:1px solid var(--rule); border-radius:var(--radius); padding:14px 16px; display:flex; flex-direction:column; gap:8px; min-width:0; }
.card.launching { border-style:dashed; } .card.launching .transcript { display:none; }
.card .who { display:flex; justify-content:space-between; gap:8px; align-items:baseline; flex-wrap:wrap; }
.card .who strong { font-weight:500; cursor:pointer; text-decoration:underline; text-decoration-color:var(--rule); text-underline-offset:3px; }
.card .task { font-size:.95rem; }
.card .facts { font-size:.78rem; color:var(--muted); font-family:var(--mono); display:flex; gap:12px; flex-wrap:wrap; }
.transcript { background:var(--paper); border:1px solid var(--rule); border-radius:var(--radius-s); padding:8px 10px; max-height:260px; overflow:auto; font-size:.8rem; line-height:1.45; }
.transcript div { margin:2px 0; white-space:pre-wrap; word-break:break-word; }
.transcript .think { color:var(--muted); font-style:italic; }
.transcript .tool { font-family:var(--mono); }
.transcript .result { font-weight:500; }
.transcript .status { color:var(--muted); font-family:var(--mono); font-size:.72rem; display:block; }
.board { display:grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap:16px; }
.column h3 { margin:0 0 8px; font-size:.72rem; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); font-weight:400; }
.column h3 .num { margin-left:6px; }
.column ul { list-style:none; margin:0; padding:0; }
.column li { border-top:1px solid var(--rule); padding:6px 0; font-size:.9rem; }
.column li .id { font-family:var(--mono); color:var(--muted); font-size:.75rem; margin-right:6px; }
.column li .why { display:block; font-size:.78rem; color:var(--muted); }
.column li .why.launch { color:var(--live); } .column li .why.skip { color:var(--warn); }
table { border-collapse:collapse; width:100%; font-size:.88rem; }
th, td { text-align:left; vertical-align:top; padding:7px 10px 7px 0; border-bottom:1px solid var(--rule); }
th { font-weight:400; font-size:.72rem; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); }
td.mono { font-family:var(--mono); font-size:.8rem; }
.status-available { color:var(--live); } .status-leased { color:var(--ink); } .status-quarantined { color:var(--stop); } .status-revoked { color:var(--muted); }
#identities tbody tr { cursor:pointer; } #identities tbody tr:hover { background:var(--tint); }
.legend { margin-top:8px; line-height:1.5; } .legend b { font-weight:500; color:var(--ink); }
.activity { list-style:none; margin:0; padding:0; font-size:.82rem; max-height:460px; overflow:auto; }
.activity li { border-top:1px solid var(--rule); padding:5px 0; display:grid; grid-template-columns: 78px 150px 1fr; gap:10px; }
.activity .ts { font-family:var(--mono); color:var(--muted); font-size:.75rem; }
.activity .kind { font-family:var(--mono); font-size:.78rem; }
.activity .kind.bad { color:var(--stop); } .activity .kind.good { color:var(--live); }
.activity .detail { color:var(--muted); word-break:break-word; }
.prompt { background:var(--card); border:1px solid var(--rule); border-radius:var(--radius); padding:10px 12px 8px; box-shadow: 0 1px 2px rgba(31,35,28,.04); transition: border-color .2s var(--ease); }
.prompt:focus-within { border-color:var(--muted); }
.prompt textarea { width:100%; border:0; background:transparent; color:var(--ink); font:inherit; resize:none; padding:2px 2px 6px; outline:none; min-height:28px; max-height:200px; line-height:1.5; }
.prompt-bar { display:flex; align-items:center; gap:10px; border-top:1px solid var(--rule); padding-top:8px; }
.prompt-hint { flex:1; font-size:.8rem; color:var(--muted); min-width:0; }
.prompt-opt { font-size:.8rem; color:var(--muted); display:inline-flex; align-items:center; gap:6px; } .prompt-opt input { width:64px; padding:3px 6px; font-size:.8rem; }
button.send { width:32px; height:32px; padding:0; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; font-size:1rem; line-height:1; }
button.send[disabled] { opacity:.35; }
.mission-prompt { margin-bottom:14px; }
.thread { display:flex; flex-direction:column; gap:10px; margin:14px 0; max-height:520px; overflow:auto; padding:2px; }
.msg { display:flex; gap:10px; max-width:88%; }
.msg.you { align-self:flex-end; flex-direction:row-reverse; }
.msg .who { width:28px; height:28px; border-radius:var(--radius-s); flex:none; display:inline-flex; align-items:center; justify-content:center; background:var(--tint); font-size:.72rem; font-family:var(--mono); color:var(--muted); }
.msg .bubble { border-radius:var(--radius); padding:10px 14px; font-size:.92rem; line-height:1.5; background:var(--card); border:1px solid var(--rule); }
.msg.you .bubble { background:var(--ink); color:var(--paper); border-color:var(--ink); }
.msg .meta { font-size:.72rem; color:var(--muted); font-family:var(--mono); margin-top:4px; }
.msg.you .meta { text-align:right; }
.msg .md { white-space:pre-line; } .msg .md h1 { display:none; } .msg .md h2 { font-size:.85rem; margin:10px 0 2px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); font-weight:500; }
.msg.system { align-self:center; max-width:100%; } .msg.system .bubble { background:transparent; border:0; color:var(--muted); font-size:.8rem; padding:4px 0; }
.adopt{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.adopt-tip{font-size:12px;padding:3px 8px;border:1px solid var(--rule,#ddd);background:transparent;border-radius:999px;cursor:pointer;text-align:left;color:inherit}.adopt-tip:hover{background:var(--paper-2,#f4f1ea)}.adopt-tip:disabled{opacity:.6;cursor:default}
.typing { display:inline-flex; gap:4px; align-items:center; } .typing i { width:6px; height:6px; border-radius:50%; background:var(--muted); animation: typing 1.2s infinite ease-in-out; } .typing i:nth-child(2) { animation-delay:.15s; } .typing i:nth-child(3) { animation-delay:.3s; }
@keyframes typing { 0%, 80%, 100% { transform: translateY(0); opacity:.5 } 40% { transform: translateY(-4px); opacity:1 } }
.space-panel { border:1px solid var(--rule); border-radius:var(--radius-s); padding:12px 16px; margin:10px 0 14px; display:grid; grid-template-columns: 1fr auto; gap:6px 24px; align-items:start; background:var(--paper-2, transparent); }
.space-panel .sp-name { font-weight:600; font-size:1.02rem; } .space-panel .sp-name a { text-decoration:none; }
.space-panel .sp-purpose { margin:2px 0 0; font-size:.92rem; }
.space-panel .sp-charter { margin:6px 0 0; font-size:.88rem; color:var(--muted); line-height:1.45; max-height:4.4em; overflow:hidden; white-space:pre-wrap; }
.space-panel .sp-charter.open { max-height:none; }
.space-panel .more { font-size:.78rem; color:var(--muted); background:transparent; border:0; padding:2px 0; cursor:pointer; text-decoration:underline; }
.space-panel .sp-facts { grid-column: 1 / -1; display:flex; flex-wrap:wrap; gap:6px 18px; font-size:.82rem; color:var(--muted); margin-top:4px; }
.space-panel .sp-facts b { color:var(--ink); font-weight:500; }
.space-panel .sp-links { display:flex; gap:12px; font-size:.85rem; white-space:nowrap; }
.tally { margin: 6px 0 14px; }
.tally table { border-collapse: collapse; width: 100%; max-width: 560px; font-size: .92rem; }
.tally td { padding: 6px 8px 6px 0; border-top: 1px solid var(--rule); }
.tally td.n { text-align: right; font-family: var(--mono); width: 90px; }
.tally tr:first-child td { border-top: 0; }
.tally .since { color: var(--muted); font-size: .8rem; margin: 0 0 6px; }
.tally details { margin-top: 6px; font-size: .88rem; } .tally summary { cursor: pointer; color: var(--muted); }
.tally details ul { margin: 4px 0 0 18px; padding: 0; }
.tl-head { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; flex-wrap:wrap; }
.tl-filters { display:flex; gap:4px; flex-shrink:0; } .tl-filters .ghost { font-size:.8rem; padding:3px 9px; border:1px solid var(--rule); border-radius:999px; background:transparent; color:var(--muted); cursor:pointer; }
.tl-filters .ghost.on { color:var(--ink); border-color:var(--ink); }
.timeline { list-style:none; margin:0; padding:0; max-height:640px; overflow:auto; }
.timeline li.day { padding:10px 0 4px; font-family:var(--mono); font-size:.75rem; color:var(--muted); letter-spacing:.04em; text-transform:uppercase; }
.timeline li.ev { display:grid; grid-template-columns:52px 1fr; gap:12px; padding:8px 0; border-top:1px solid var(--rule); font-size:.92rem; }
.timeline .ts { font-family:var(--mono); font-size:.75rem; color:var(--muted); padding-top:2px; }
.timeline .who { font-family:var(--mono); font-size:.85rem; } .timeline .other .who { color:var(--muted); }
.timeline .verb.good { color:var(--live); } .timeline .verb.warn { color:var(--warn); }
.timeline .said { margin:4px 0 0; white-space:pre-wrap; color:var(--ink); font-size:.88rem; line-height:1.45; max-height:5.8em; overflow:hidden; position:relative; }
.timeline .said.open { max-height:none; }
.timeline .more { font-size:.78rem; color:var(--muted); background:transparent; border:0; padding:2px 0; cursor:pointer; text-decoration:underline; }
.timeline .other .said { color:var(--muted); }
.contrib { list-style:none; margin:0; padding:0; max-height:380px; overflow:auto; }
.contrib li { display:grid; grid-template-columns: 62px 1fr; gap:12px; padding:7px 0; border-top:1px solid var(--rule); font-size:.92rem; align-items:baseline; }
.contrib .ts { font-family:var(--mono); font-size:.75rem; color:var(--muted); }
.contrib .who { font-family:var(--mono); font-size:.85rem; }
.contrib .verb { color:var(--ink); } .contrib .verb.good { color:var(--live); } .contrib .verb.warn { color:var(--warn); }
.contrib .other { color:var(--muted); }
.flash { font-size:.8rem; color:var(--live); }
.drawer { position:fixed; top:0; right:0; height:100vh; width:min(560px, 100vw); background:var(--card); border-left:1px solid var(--rule); box-shadow:-8px 0 24px rgba(0,0,0,.08); z-index:50; display:flex; flex-direction:column; }
.drawer-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; padding:20px 22px 12px; border-bottom:1px solid var(--rule); }
.drawer-body { overflow:auto; padding:8px 22px 40px; } .drawer-body h3 { margin:18px 0 6px; font-size:.72rem; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); font-weight:400; }
.drawer .prompt { background:var(--paper); border:1px solid var(--rule); border-radius:var(--radius-s); padding:10px 12px; font-size:.74rem; line-height:1.45; white-space:pre-wrap; word-break:break-word; max-height:320px; overflow:auto; font-family:var(--mono); }
ul.plain { list-style:none; padding:0; margin:0; } ul.plain li { border-top:1px solid var(--rule); padding:5px 0; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position:static; height:auto; border-right:0; border-bottom:1px solid var(--rule); }
  .side-nav { flex-direction:row; flex-wrap:wrap; }
  .side-actions { flex-direction:row; flex-wrap:wrap; } .side-actions button { width:auto; }
  .crumb { display:none; }
  .content { padding: 20px 18px 80px; }
}
