:root {
  --bg: #f6f3ec; --panel: #fffdf8; --ink: #1d2523; --muted: #5d6865; --line: #e3ddd0;
  --accent: #b4501a; --accent-ink: #f3efe6; --soft: #e6efe9; --warn: #9a5b12; --warn-soft: #f7ead6;
  --bad: #9b2c2c; --bad-soft: #f6e1df; --good: #2f6b3a; --good-soft: #e1efe2;
  --radius: 12px; --gap: 12px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
/* dark when the device is dark, unless the person picked light; or whenever they picked dark */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121615; --panel: #1a201f; --ink: #e8ece9; --muted: #9aa6a2; --line: #2b3331;
    --accent: #f0a060; --accent-ink: #0f1514; --soft: #1f2d2a; --warn: #e2b071; --warn-soft: #2e2618;
    --bad: #ef9a92; --bad-soft: #321d1b; --good: #8fcf98; --good-soft: #1b2b1e;
  }
}
:root[data-theme="dark"] {
    --bg: #121615; --panel: #1a201f; --ink: #e8ece9; --muted: #9aa6a2; --line: #2b3331;
    --accent: #f0a060; --accent-ink: #0f1514; --soft: #1f2d2a; --warn: #e2b071; --warn-soft: #2e2618;
    --bad: #ef9a92; --bad-soft: #321d1b; --good: #8fcf98; --good-soft: #1b2b1e;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
.theme-switch { font-size: 15px; line-height: 1; padding: 4px 9px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--font); padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.pad { padding: 16px; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; }
.mark { width: 22px; height: 22px; border-radius: 6px; background: url(/icon.svg) center / cover; }
.top-right { display: flex; align-items: center; gap: 6px; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
button.chip { cursor: pointer; }
.chip.me { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.live { font-size: 12px; color: var(--muted); }
.live.on::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--good); vertical-align: 1px; }

.score { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 12px 16px 4px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; min-width: 0; }
.tile b { display: block; font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile span { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.banner { margin: 8px 16px 0; padding: 8px 12px; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn); font-size: 14px; }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 6; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--panel); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { border: 0; background: none; padding: 12px 4px; font-size: 14px; color: var(--muted); cursor: pointer; }
.tabs button.on { color: var(--accent); font-weight: 650; box-shadow: inset 0 3px 0 var(--accent); }
@media (min-width: 760px) {
  body { padding-bottom: 24px; }
  .tabs { position: sticky; top: 49px; bottom: auto; max-width: 880px; margin: 8px auto 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
  .tabs button.on { box-shadow: inset 0 -3px 0 var(--accent); }
  .score, .banner { max-width: 880px; margin-left: auto; margin-right: auto; }
}
main { max-width: 880px; margin: 0 auto; padding: 12px 16px; }
.tab { display: none; }
.tab.on { display: block; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: var(--gap); overflow-wrap: anywhere; }
.card h2 { font-size: 17px; margin: 0 0 6px; letter-spacing: -0.01em; }
.card h3 { font-size: 14px; margin: 12px 0 4px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.meta { font-size: 13px; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.grow { flex: 1 1 auto; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--soft); color: var(--accent); white-space: nowrap; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.good { background: var(--good-soft); color: var(--good); }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain > li { padding: 8px 0; border-top: 1px solid var(--line); }
ul.plain > li:first-child { border-top: 0; }
ul.res-notes { list-style: none; margin: 6px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--line); font-size: 0.92em; }
ul.res-notes > li { padding: 3px 0; }
.next { border-left: 3px solid var(--accent); padding-left: 10px; margin: 8px 0; }
.why { color: var(--muted); font-size: 14px; }
details summary { cursor: pointer; color: var(--muted); font-size: 14px; }
pre { font: 12px/1.4 var(--mono); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; overflow: auto; max-height: 360px; white-space: pre-wrap; word-break: break-all; }
code { font: 12px var(--mono); overflow-wrap: anywhere; }

label { display: block; font-size: 14px; color: var(--muted); margin: 10px 0 4px; }
input[type=text], input[type=number], input[type=date], select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); min-height: 44px; }
textarea { min-height: 92px; resize: vertical; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--ink); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; text-decoration: none; color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.small { min-height: 34px; padding: 4px 10px; font-size: 14px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--panel); padding: 8px 12px; cursor: pointer; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.qr { width: 200px; height: 200px; background: #fff; border-radius: 10px; padding: 6px; }
.qr.small { width: 148px; height: 148px; display: block; }
.join-qr { max-width: 360px; }
.join-qr .why { margin: 0 0 8px; }
.spark { width: 100%; height: 48px; display: block; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 2; }
.feed-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; }
.feed-item .what { grid-column: 1 / -1; }
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 14px; border-radius: 10px; background: var(--ink); color: var(--bg); font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 10; }
.toast.show { opacity: 1; }
.empty { color: var(--muted); font-size: 14px; }

/* ---------- Watch: the loom ---------- */
:root { --gold: #d9a441; --loom-bg: #0e1416; --loom-ink: #e9efe9; }
body[data-tab="watch"] #score, body[data-tab="watch"] #banner { display: none; }
.watch-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 10px; }
.watch-head .here { font-size: 14px; color: var(--muted); }
.loom-wrap { position: relative; height: min(62vh, 640px); min-height: 360px; border-radius: 18px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 45%, #18252a 0%, var(--loom-bg) 70%); border: 1px solid #1f2b2e; }
.loom { width: 100%; height: 100%; display: block; }
.loom .label { fill: var(--loom-ink); opacity: 0.85; font-family: var(--font); paint-order: stroke; stroke: var(--loom-bg); stroke-width: 3px; }
.loom .label.small { opacity: 0.7; }
.loom .core-label { fill: var(--gold); opacity: 0.9; text-anchor: middle; }
.loom .core-ring { fill: none; stroke: var(--gold); stroke-width: 1.5; opacity: 0.5; transform-box: fill-box; transform-origin: center; animation: breathe 4s ease-in-out infinite; }
.loom .core-ring.r2 { animation-delay: -2s; }
.loom .core-dot { fill: var(--gold); filter: url(#glow); }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: 0.55; } 50% { transform: scale(1.35); opacity: 0.15; } }
.loom .node { cursor: pointer; }
.loom .tether { stroke-width: 1; opacity: 0.35; stroke-dasharray: 3 4; }
.loom .thread { fill: none; stroke-linecap: round; opacity: 0.95; filter: url(#glow); }
.loom .thread.gold { stroke: var(--gold); }
.loom .strand { fill: none; stroke-linecap: round; opacity: 0.32; transition: opacity 1.5s; }
.loom .strand.gold { stroke: var(--gold); opacity: 0.45; }
.loom .ripple { fill: none; stroke-width: 2; }
.loom .gold-ripple { stroke: var(--gold); }
@media (prefers-reduced-motion: reduce) { .loom .core-ring { animation: none; } }
.bubbles { position: absolute; inset: 0; pointer-events: none; }
.bubble { position: absolute; padding: 8px 10px; border-radius: 12px; background: rgba(20, 30, 33, 0.92); color: var(--loom-ink);
  border: 1px solid #2c3a3e; font-size: 13px; line-height: 1.35; box-shadow: 0 6px 24px rgba(0,0,0,.35); transition: opacity .8s, transform .8s; animation: pop .35s ease-out; }
.bubble b { display: block; font-size: 12px; opacity: 0.75; margin-bottom: 2px; font-weight: 600; }
.bubble.gold { border-color: var(--gold); }
.bubble.gold b { color: var(--gold); opacity: 1; }
.bubble.out { opacity: 0; transform: translateY(-6px); }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(4px); } to { opacity: 1; transform: none; } }
.caps-card { margin-top: 12px; }
.captions { list-style: none; margin: 0; padding: 0; }
.cap { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-top: 1px solid var(--line); font-size: 15px; }
.cap:first-child { border-top: 0; }
.cap .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; transform: translateY(-1px); }
.cap.weaver strong { color: var(--gold); }
.cap.fading { animation: cap-fade 120s linear forwards; } /* the loom's two minutes; the delay is each line's age */
@keyframes cap-fade { 0% { opacity: 1; } 60% { opacity: 0.55; } 100% { opacity: 0; } }
.caps-note { margin: -4px 0 6px; font-size: 13px; }
.watch-about { color: var(--muted); font-size: 14px; text-align: center; margin: 14px 8px 4px; }
.section-title { font-size: 17px; margin: 8px 0 0; }

/* ---------- the bring-your-agent sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-card { position: relative; width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; background: var(--panel); color: var(--ink);
  border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0,0,0,.3); }
@media (min-width: 760px) { .sheet { align-items: center; } .sheet-card { border-radius: 18px; } }
.sheet-card h2 { margin: 0 32px 6px 0; font-size: 19px; }
.sheet-x { position: absolute; top: 12px; right: 12px; }
.linkbox { display: flex; gap: 8px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 8px 0; }
.linkbox code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 12px; }
.steps { padding-left: 20px; margin: 10px 0; }
.steps li { margin: 8px 0; }
.steps code { display: inline-block; margin-top: 4px; }
.agent-row { padding: 10px 0; border-top: 1px solid var(--line); }
.agent-row:first-of-type { border-top: 0; }
.keep { margin-top: 8px; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 10px; }
.keep code { overflow-wrap: anywhere; }

/* ---------- Plain or Technical ---------- */
body[data-view="plain"] .tech-only { display: none !important; }
body[data-view="tech"] .plain-only { display: none !important; }
.view-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.view-switch button { border: 0; background: var(--panel); padding: 3px 9px; font-size: 12px; cursor: pointer; color: var(--muted); }
.view-switch button.on { background: var(--ink); color: var(--bg); }
@media (max-width: 420px) { .brand span:last-child { display: none; } #live { font-size: 0; } #live.on::before { margin-right: 0; } }

/* ---------- Talk: one chat ---------- */
.goals-strip { font-size: 14px; padding: 8px 12px; margin-bottom: 8px; border-radius: 10px; background: var(--soft); }
.chat { display: flex; flex-direction: column; gap: 8px; min-height: 40vh; max-height: calc(100vh - 260px); overflow-y: auto; padding: 4px 2px 8px; }
@media (min-width: 760px) { .chat { max-height: calc(100vh - 300px); } }
.msg { max-width: 86%; align-self: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; padding: 8px 12px; overflow-wrap: anywhere; }
.msg .text { cursor: text; user-select: text; }
.btn.tiny { min-height: 24px; padding: 1px 8px; font-size: 12px; border-radius: 7px; }
.listen { flex: none; display: inline-block; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--muted); opacity: 0.7; vertical-align: middle; }
.listen.on { background: var(--good); border-color: var(--good); opacity: 1; }
.msg .read { color: var(--good); }
.reply-chip .deaf { color: var(--warn); }
.msg-actions { display: inline-flex; gap: 4px; opacity: 0; transition: opacity 0.12s; }
.msg:hover .msg-actions, .msg:focus-within .msg-actions { opacity: 1; }
@media (hover: none) { .msg-actions { opacity: 1; } }
.msg.mine { align-self: flex-end; background: var(--soft); border-radius: 16px 16px 4px 16px; }
.msg.agent { border-style: dashed; }
.msg.private { opacity: 0.8; border-style: dotted; }
.msg.weaver { align-self: stretch; max-width: none; border-color: var(--gold); background: color-mix(in srgb, var(--gold) 9%, var(--panel)); cursor: default; }
.msg.card-msg { cursor: default; }
.msg .who { font-size: 12px; color: var(--muted); margin-bottom: 2px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.msg .who .dot, .cap .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.msg .for { opacity: 0.85; }
.msg .time { margin-left: auto; opacity: 0.7; }
.msg .text { font-size: 15px; line-height: 1.4; }
.msg .text + .text { margin-top: 4px; }
.msg .quote { font-size: 13px; color: var(--muted); border-left: 2px solid var(--line); padding-left: 8px; margin: 2px 0 4px; }
.msg .row { margin-top: 6px; }
.tech-line { font: 11px var(--mono); color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.sys { align-self: center; font-size: 12px; color: var(--muted); text-align: center; max-width: 92%; }
.sys .time { opacity: 0.7; }
/* the @ list opens upward from the Talk box */
.mention-list { position: absolute; left: 0; right: 0; bottom: 100%; margin-bottom: 4px; max-height: 50vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 -6px 20px rgba(0, 0, 0, .12); padding: 4px; z-index: 6; }
.mention-list[hidden] { display: none; }
.mention { display: block; width: 100%; text-align: left; border: 0; background: none; color: var(--ink); font: inherit; font-size: 15px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.mention.under { padding-left: 26px; color: var(--muted); font-size: 14px; }
.mention.active, .mention:hover { background: var(--soft); color: var(--ink); }
.composer { position: sticky; bottom: calc(58px + env(safe-area-inset-bottom)); background: var(--bg); padding: 8px 0 4px; border-top: 1px solid var(--line); z-index: 4; }
@media (min-width: 760px) { .composer { bottom: 0; } }
.composer-row { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { min-height: 44px; max-height: 160px; resize: none; border-radius: 22px; padding: 11px 16px; }
.composer .send { width: 44px; min-width: 44px; height: 44px; border-radius: 50%; font-size: 20px; padding: 0; }
.composer .seg { margin-top: 6px; }
.seg.small button { padding: 4px 10px; font-size: 13px; }
.reply-chip { font-size: 13px; color: var(--muted); background: var(--soft); border-radius: 10px; padding: 4px 4px 4px 10px; margin-bottom: 6px; }
.reply-chip[hidden] { display: none; }

/* ---------- Map: a real map ---------- */
.map-stats { font-size: 14px; color: var(--muted); margin: 0 0 8px; }
.graph-wrap { position: relative; height: min(68vh, 720px); min-height: 380px; border-radius: 18px; overflow: hidden; background: radial-gradient(ellipse at 50% 45%, #18252a 0%, var(--loom-bg) 75%); border: 1px solid #1f2b2e; }
.graph { width: 100%; height: 100%; display: block; }
.graph .edge { fill: none; stroke-linecap: round; }
.graph .edge.connection { stroke: #5fd3a8; opacity: 0.9; }
.graph .edge.faded { stroke: #8a9a97; stroke-dasharray: 2 6; opacity: 0.7; }
.graph .edge.broken { stroke: #ef6f6c; stroke-dasharray: 10 8; opacity: 0.9; }
.graph .break-mark { fill: #ef6f6c; font-weight: 700; }
.graph .edge.potential { stroke: #7fa7d9; stroke-dasharray: 1 7; opacity: 0.45; }
.graph .edge.tether { stroke: #e9efe9; opacity: 0.35; }
.graph .edge.suggested { stroke: var(--gold); opacity: 0.85; }
.graph .edge.intention { stroke: #b08cf0; stroke-dasharray: 6 5; opacity: 0.85; }
.graph .arrowhead { fill: #b08cf0; }
.graph .edge.tension { stroke: #f29a4a; opacity: 0.9; }
.graph .node { cursor: pointer; }
.graph .node circle { fill: #c9b48a; stroke: #0e1416; stroke-width: 2; }
.graph .node.dtg circle { fill: #4fb3a6; }
.graph .node.person circle { fill: #e9efe9; }
.graph .node.lonely { opacity: 0.55; }
.graph .node text { fill: var(--loom-ink); font-family: var(--font); paint-order: stroke; stroke: var(--loom-bg); stroke-width: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip.key { cursor: pointer; gap: 6px; max-width: none; }
.chip.key i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; background: currentColor; }
.chip.key.off { opacity: 0.45; text-decoration: line-through; }
.chip.key.connection i { background: #5fd3a8; } .chip.key.faded i { background: repeating-linear-gradient(90deg, #8a9a97 0 2px, transparent 2px 6px); }
.chip.key.broken i { background: #ef6f6c; } .chip.key.potential i { background: #7fa7d9; } .chip.key.tether i { background: #c8d0cc; }
.chip.key.suggested i { background: var(--gold); } .chip.key.intention i { background: #b08cf0; } .chip.key.tension i { background: #f29a4a; }
.notebook ul.plain li { font-size: 14px; }

/* ---------- built for computers ---------- */
@media (min-width: 1000px) {
  main, .tabs, .score, .banner { max-width: 1240px; }
  .watch-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: stretch; }
  .watch-grid .loom-wrap { height: calc(100vh - 230px); min-height: 520px; max-height: none; }
  .watch-grid .caps-card { margin: 0; height: calc(100vh - 230px); min-height: 520px; overflow-y: auto; }
  .watch-about { text-align: left; margin-left: 4px; }
  #tab-talk { max-width: 860px; margin: 0 auto; }
  .chat { max-height: calc(100vh - 290px); min-height: 50vh; }
  .msg { max-width: 72%; }
  .map-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
  .map-grid .graph-wrap { height: calc(100vh - 290px); min-height: 520px; max-height: none; }
  .map-side { position: sticky; top: 110px; max-height: calc(100vh - 140px); overflow-y: auto; margin: 0; }
  .map-side h2 { margin-top: 0; }
  .sheet-card { max-width: 620px; }
}
@media (max-width: 999px) { .map-side { display: none; } }

.chip.repo { text-decoration: none; color: var(--ink); gap: 5px; }
.chip.repo:hover { border-color: var(--muted); }
.badge.away { background: var(--warn-soft); color: var(--warn); font-size: 11px; padding: 0 6px; }
.switch { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 15px; margin: 4px 0 8px; }
.keep h3 { margin-top: 14px; }

/* coming in: you, then your agent */
.welcome { position: relative; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.welcome h2 { font-size: 19px; margin-right: 120px; }
.welcome.slim { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-bottom: var(--gap); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); font-size: 14px; }
.welcome-x { position: absolute; top: 12px; right: 12px; }
.welcome > label, .welcome > .row, .welcome > details, .welcome > .why, .welcome > .big-step, .welcome > .live-checks, .welcome > .keep { max-width: 620px; }
.stepper { display: flex; gap: 6px; list-style: none; padding: 0; margin: 10px 0 4px; flex-wrap: wrap; }
.stepper li { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.stepper li b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); font-size: 12px; }
.stepper li.on { color: var(--ink); border-color: var(--accent); }
.stepper li.on b { background: var(--accent); color: var(--accent-ink); }
.stepper li.done { color: var(--good); }
.stepper li.done b { background: var(--good-soft); color: var(--good); }
.big-step { margin: 10px 0; padding: 12px; border-radius: 10px; background: var(--soft); }
.big-step p { margin: 0 0 8px; }
.big-step .steps { margin-bottom: 0; }
.big-step pre { max-height: 260px; overflow: auto; font-size: 11px; }
.live-checks { list-style: none; padding: 0; margin: 8px 0; font-size: 14px; }
.live-checks li { display: flex; align-items: baseline; gap: 8px; padding: 2px 0; color: var(--muted); }
.live-checks li b { width: 16px; text-align: center; }
.live-checks li.ok { color: var(--ink); }
.live-checks li.ok b { color: var(--good); }
@media (max-width: 520px) { .welcome h2 { margin-right: 0; margin-top: 28px; } }
.chip.me { flex-shrink: 0; }
@media (max-width: 700px) { .repo-word { display: none; } .chip.repo { padding: 3px 7px; } }
.tabs .count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; line-height: 18px; }
.tabs .count[hidden] { display: none; }
.decision h3.decision-title { margin: 4px 0; font-size: 16px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.decision.closed { opacity: 0.8; }
.step-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.step-row:first-of-type { border-top: 0; }
.step-row .mark { width: 11px; height: 11px; flex: none; margin: 5px 4px 0; border-radius: 50%; border: 2px solid var(--muted); box-sizing: border-box; }
.step-row .mark.st-claimed, .step-row .mark.st-in-progress { border-color: var(--accent); background: linear-gradient(90deg, var(--accent) 50%, transparent 50%); }
.step-row .mark.st-result-posted { border-color: var(--accent); background: var(--accent); }
.step-row .mark.st-checked { border-color: var(--good); background: var(--good); }
.step-row .mark.st-waiting { border-color: var(--warn); background: var(--warn); border-radius: 2px; }
.step-row.waiting { background: var(--warn-soft); margin: 0 -8px; padding: 8px; border-radius: 6px; }
.step-row.done { opacity: 0.75; }
.step-row .step-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.step-row .step-actions .btn { white-space: nowrap; }
.step-row .grow { flex: 1 1 0; min-width: 0; }
@media (max-width: 520px) { .step-row { flex-wrap: wrap; } .step-row .step-actions { flex-basis: 100%; justify-content: flex-start; padding-left: 29px; } }
.decision .need { color: var(--accent); }
h2.decided { font-size: 15px; margin: 18px 0 8px; color: var(--muted); }
.workshop-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.workshop-list li:last-child { border-bottom: 0; }
.why.pre { white-space: pre-wrap; font-size: 13px; }
@media (max-width: 420px) { .tabs button { font-size: 12px; padding: 12px 1px; } }
.check-line { font-size: 13px; margin: 8px 0; padding: 6px 10px; border-radius: 8px; }
.check-line.ok { background: var(--good-soft); color: var(--good); }
.check-line.bad { background: var(--warn-soft); color: var(--warn); }
.check-line a { color: inherit; }
input[type=url] { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); min-height: 44px; font: inherit; }
.text.deeper { margin-top: 6px; padding: 6px 0 2px 10px; border-left: 2px solid var(--line); color: var(--muted); font-size: 13px; white-space: pre-wrap; }
.msg.from-agent { border-style: dashed; }
.seg.where { margin: 4px 0 6px; }
.msg.draft { border-style: dashed; border-color: var(--accent); }
.agent-row .mode { margin: 6px 0; }
.agent-row .mode .seg { flex-wrap: wrap; }
.layers { margin-top: 2px; }
.layer-tabs { display: flex; gap: 4px; margin: 2px 0 6px; }
.layer-tabs .btn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.layer { border-radius: 10px; padding: 8px 10px; background: color-mix(in srgb, var(--bg) 60%, transparent); border: 1px solid var(--line); }
.layer.card-depth .text { font-size: 14px; white-space: pre-wrap; }
.layer-title { font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.photos { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.photos img { max-width: min(100%, 420px); max-height: 360px; width: auto; height: auto; border-radius: 10px; border: 1px solid var(--line); display: block; }
.photo-tray { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.photo-tray[hidden] { display: none; }
.tray-item { position: relative; display: inline-block; }
.tray-item img { height: 64px; border-radius: 8px; border: 1px solid var(--line); display: block; }
.tray-item .btn { position: absolute; top: 2px; right: 2px; min-height: 20px; padding: 0 6px; }
.btn.attach { min-width: 40px; padding: 6px 8px; }
@media (max-width: 420px) { .tabs button { font-size: 13px; padding: 12px 2px; } .tabs .count { margin-left: 2px; padding: 0 4px; } }
.seg.tiles { display: flex; flex-wrap: wrap; margin: 4px 0 8px; }
.seg.tiles button { flex: 1 1 auto; }
.files { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.doc-chip { display: inline-block; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 13px; text-decoration: none; color: var(--ink); max-width: 100%; overflow-wrap: anywhere; }
.tray-item.doc .btn { position: static; margin-left: 4px; }

/* the key step at join: the key itself, easy to select */
pre.key { white-space: pre-wrap; word-break: break-all; user-select: all; padding: 10px; border-radius: 8px; background: var(--soft); font-size: 13px; }
label.check { display: flex; gap: 8px; align-items: center; }
/* lines for you: addressed to you, naming you, or answering you */
.msg.for-me { box-shadow: inset 3px 0 0 var(--accent); }
.badge.for-me { background: var(--accent); color: var(--accent-ink); }
.for-me-count { display: inline-block; min-width: 18px; margin-left: 5px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; line-height: 18px; text-align: center; }
