/* Qyrvexa.ai — operate surface. Warm paper, deep ink, ultramarine for action, lime for the one thing that starts work. */
:root {
  --bg: #f4f2ec;
  --bg-2: #ece9e1;
  --surface: #fffefb;
  --surface-2: #f3f0e8;
  --text: #16171b;
  --muted: #55575e;
  --faint: #7c7e85;
  --line: #e2ded4;
  --line-strong: #cfcabd;
  --accent: #3434e0;
  --accent-ink: #ffffff;
  --accent-soft: #e7e7fd;
  --lime: #c6f24e;
  --lime-ink: #1b2604;
  --ok: #146a43;
  --ok-soft: #dff2e7;
  --warn: #7f4f00;
  --warn-soft: #fbefd6;
  --bad: #b42318;
  --bad-soft: #fbe5e2;
  --violet: #6d3fd0;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-1: 0 1px 2px rgb(22 23 27 / .05), 0 2px 8px rgb(22 23 27 / .04);
  --shadow-2: 0 8px 24px rgb(22 23 27 / .10), 0 2px 6px rgb(22 23 27 / .06);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --font: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --serif: "Newsreader", ui-serif, Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0f12;
    --bg-2: #131418;
    --surface: #17181d;
    --surface-2: #1f2027;
    --text: #eceae4;
    --muted: #a9aab0;
    --faint: #8a8c93;
    --line: #2a2b33;
    --line-strong: #3a3b45;
    --accent: #9a9aff;
    --accent-ink: #0e0f12;
    --accent-soft: #23234a;
    --ok: #63d69a;
    --ok-soft: #13301f;
    --warn: #f2bd5c;
    --warn-soft: #382a10;
    --bad: #ff8b7e;
    --bad-soft: #3b1714;
    --violet: #b49bff;
    --shadow-1: 0 1px 2px rgb(0 0 0 / .3);
    --shadow-2: 0 10px 30px rgb(0 0 0 / .45);
  }
}

* { box-sizing: border-box; }
html { scrollbar-color: var(--line-strong) transparent; }
body { margin: 0; background: var(--bg); color: var(--text); font: 450 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
::selection { background: var(--lime); color: var(--lime-ink); }
input, textarea { caret-color: var(--accent); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5rem; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: 1.65rem; font-weight: 650; }
h2 { font-size: 1.02rem; font-weight: 620; }
h3 { font-size: .92rem; font-weight: 620; }
.muted { color: var(--muted); }
.mono, code { font-family: var(--mono); font-size: .84em; }
table, .stat b, .num { font-variant-numeric: tabular-nums; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 10px 22px; position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; gap: 9px; align-items: center; font-size: 1rem; letter-spacing: -0.02em; }
.brand.big { font-size: 1.15rem; }
.mark { width: 22px; height: 22px; border-radius: 7px; background: var(--text); position: relative; flex: none; }
.mark::after { content: ""; position: absolute; inset: 6px 5px 5px 6px; border-radius: 3px; background: var(--lime); transform: rotate(-12deg); }
.office-switch { position: relative; }
.office-switch button, .office-switch .static {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 560; font-size: .84rem; color: var(--text);
}
.office-switch .ic { width: 15px; height: 15px; color: var(--muted); }
.office-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 280px; background: var(--surface); border: 0; border-radius: var(--radius); box-shadow: var(--shadow-2); padding: 6px; z-index: 20; animation: menu-in .18s var(--ease); }
.office-menu button { display: grid; grid-template-columns: 1fr auto; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: transparent; }
.office-menu button:hover, .office-menu button[aria-current] { background: var(--surface-2); }
.office-menu small { color: var(--muted); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
.tabs { display: flex; gap: 2px; flex: 1; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { white-space: nowrap; padding: 6px 11px; border-radius: 999px; color: var(--muted); font-weight: 520; transition: background .15s, color .15s; }
.tabs a:hover { text-decoration: none; color: var(--text); background: var(--bg-2); }
.tabs a[aria-current="page"] { color: var(--text); background: var(--surface); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); }
.top-actions { display: flex; align-items: center; gap: 6px; }
.exec-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 580; padding: 4px 10px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); white-space: nowrap; }
.exec-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.exec-chip.off { background: var(--warn-soft); color: var(--warn); }
.actor { display: flex; align-items: center; gap: 6px; font-size: .76rem; color: var(--muted); }
.actor span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.actor select { max-width: 190px; font-size: .8rem; padding: 5px 8px; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--muted); padding: 0; }
.icon-btn:hover { background: var(--bg-2); color: var(--text); text-decoration: none; }
.badge { position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--bad); color: #fff; font-size: .66rem; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); animation: badge-in .35s var(--ease); }
@keyframes badge-in { from { transform: scale(.4); } }

main { padding: 22px 22px 72px; outline: none; max-width: 1560px; margin: 0 auto; }

/* ---------- controls ---------- */
select, input, textarea, button { font: inherit; color: inherit; }
select, input, textarea { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 7px 10px; min-width: 0; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); outline-offset: 0; border-color: var(--accent); }
textarea { width: 100%; resize: vertical; }
::placeholder { color: var(--faint); }
button { cursor: pointer; border-radius: var(--radius-sm); padding: 7px 13px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 540; display: inline-flex; align-items: center; gap: 6px; justify-content: center; transition: background .15s, border-color .15s, transform .12s var(--ease), box-shadow .15s; }
button:hover { background: var(--surface-2); }
button:active { transform: scale(.98); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 0 rgb(255 255 255 / .2) inset, 0 2px 6px rgb(22 23 27 / .16); }
button.primary:hover { filter: brightness(1.07); background: var(--accent); }
button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover { background: var(--bg-2); }
button.danger { color: var(--bad); }
button.small { padding: 4px 10px; font-size: .8rem; }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.wide-btn { width: 100%; padding: 11px; font-size: .95rem; }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.stack { display: grid; gap: 10px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; box-shadow: var(--shadow-1); }
.card > h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-items: end; }
.form label { display: grid; gap: 4px; font-size: .78rem; color: var(--muted); font-weight: 520; }
.form .wide { grid-column: 1 / -1; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 4px 0 0; max-width: 70ch; }

/* state pills */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .73rem; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.s-available, .s-accepted, .s-done, .s-qa_passed { background: var(--ok-soft); color: var(--ok); }
.s-working, .s-in_progress, .s-staging { background: var(--accent-soft); color: var(--accent); }
.s-assigned, .s-in_review, .s-waiting_review { background: var(--warn-soft); color: var(--warn); }
.s-backlog { background: var(--surface-2); color: var(--muted); }
.s-blocked, .s-qa_failed { background: var(--bad-soft); color: var(--bad); }
.s-inactive, .s-cancelled { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.s-chatting { background: color-mix(in srgb, var(--violet) 14%, var(--surface)); color: var(--violet); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); font-size: .74rem; margin: 2px 3px 0 0; color: var(--muted); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.login-art { position: relative; overflow: hidden; background: #16171b; color: #f4f2ec; display: flex; flex-direction: column; justify-content: flex-end; padding: 48px; }
.login-crowd { position: absolute; inset: -40px -40px 120px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 18px; align-content: center; transform: rotate(-8deg) scale(1.08); }
.login-crowd span { display: grid; place-items: center; aspect-ratio: 1; border-radius: 22px; background: rgb(244 242 236 / .07); animation: float 7s ease-in-out infinite; }
.login-crowd span:nth-child(3n) { animation-delay: -2s; } .login-crowd span:nth-child(4n) { animation-delay: -4.5s; }
.login-crowd span.lit { background: var(--lime); }
@keyframes float { 50% { transform: translateY(-8px); } }
.login-art::after { content: ""; position: absolute; inset: auto 0 0 0; height: 55%; background: linear-gradient(to top, #16171b 30%, transparent); pointer-events: none; }
.login-quote { position: relative; z-index: 1; font-family: var(--serif); font-size: clamp(1.8rem, 3vw, 2.8rem); line-height: 1.3; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
.login-form { align-self: center; justify-self: center; width: min(400px, calc(100% - 48px)); display: grid; gap: 14px; padding: 32px 0; }
.login-form h1 { font-size: 2.4rem; font-weight: 600; letter-spacing: -0.03em; margin: 18px 0 8px; }
.login-form h1 em { font-family: var(--serif); font-weight: 400; font-style: italic; letter-spacing: -0.01em; }
.login-form label { display: grid; gap: 5px; font-size: .8rem; color: var(--muted); font-weight: 540; }
.login-form input { padding: 11px 12px; font-size: .95rem; }

/* ---------- org chart ---------- */
.chart-wrap { overflow-x: auto; padding-bottom: 12px; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree { display: flex; justify-content: center; min-width: max-content; }
.tree li { position: relative; display: flex; flex-direction: column; align-items: center; padding: 18px 4px 0; }
.tree ul { display: flex; justify-content: center; position: relative; padding-top: 18px; }
.tree > li { padding-top: 0; }
.tree ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 18px; border-left: 1px solid var(--line-strong); }
.tree li::before, .tree li::after { content: ""; position: absolute; top: 0; height: 18px; width: 50%; border-top: 1px solid var(--line-strong); }
.tree li::before { right: 50%; }
.tree li::after { left: 50%; border-left: 1px solid var(--line-strong); }
.tree li:first-child::before, .tree li:last-child::after { border-top: 0; }
.tree li:only-child::before { display: none; }
.tree li:only-child::after { border-top: 0; }
.tree li:first-child::after { border-radius: 6px 0 0 0; }
.tree li:last-child::before { border-right: 1px solid var(--line-strong); border-radius: 0 6px 0 0; }
.tree > li::before, .tree > li::after { display: none; }
.tree ul.leaves { flex-direction: column; align-items: center; gap: 6px; }
.tree ul.leaves > li { padding: 0; }
.tree ul.leaves > li::before, .tree ul.leaves > li::after { display: none; }
.tree ul.leaves::after { content: ""; position: absolute; top: 18px; bottom: 20px; left: 50%; border-left: 1px solid var(--line-strong); z-index: -1; }
.node { display: block; width: 156px; padding: 9px 11px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-align: left; position: relative; box-shadow: var(--shadow-1); transition: transform .2s var(--ease), box-shadow .2s; }
.node:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-2); }
.node strong { display: block; font-size: .84rem; }
.node small { display: block; color: var(--muted); font-size: .72rem; line-height: 1.4; }
.node .pill { margin-top: 6px; }
.node::after { content: ""; position: absolute; top: 10px; right: 10px; width: 7px; height: 7px; border-radius: 2px; background: var(--line-strong); }
.node.unit-cell::after { background: var(--accent); }
.node.unit-cross_functional::after { background: #13a394; }
.node.unit-executive::after, .node.unit-engineering_direction::after { background: var(--text); }
.node.inactive { opacity: .55; }

/* cells */
.member { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 11px 0; border-top: 1px solid var(--line); }
.member:first-of-type { border-top: 0; }
.member .meta { grid-column: 1 / -1; font-size: .78rem; color: var(--muted); }
.bar { height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 5px; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.bar.full > span { background: var(--bad); }
.tasklist { margin: 4px 0 0; padding: 0; list-style: none; grid-column: 1 / -1; font-size: .82rem; }
.tasklist li { display: flex; gap: 6px; align-items: center; padding: 3px 0; flex-wrap: wrap; }

/* tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-top: 1px solid var(--line); vertical-align: top; }
th { font-size: .72rem; color: var(--muted); font-weight: 600; border-top: 0; }
.table-wrap { overflow-x: auto; }

/* activity */
.log { list-style: none; margin: 0; padding: 0; }
.log li { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .86rem; }
.log li:first-child { border-top: 0; }
.log time { color: var(--muted); font-size: .76rem; font-variant-numeric: tabular-nums; }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 5px 16px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: .8rem; }
dl.kv dd { margin: 0; }
.empty { color: var(--muted); padding: 10px 0; }

dialog { border: 0; border-radius: 18px; background: var(--surface); color: var(--text); width: min(460px, calc(100vw - 32px)); box-shadow: var(--shadow-2); padding: 22px; }
dialog[open] { animation: dialog-in .25s var(--ease); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
dialog::backdrop { background: rgb(14 15 18 / .4); backdrop-filter: blur(2px); }
#toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 12px); max-width: min(620px, calc(100vw - 32px)); padding: 11px 16px; border-radius: 12px; background: var(--text); color: var(--bg); font-size: .86rem; font-weight: 520; opacity: 0; pointer-events: none; transition: opacity .2s, transform .35s var(--ease); box-shadow: var(--shadow-2); z-index: 50; display: flex; gap: 12px; align-items: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast.error { background: var(--bad); color: #fff; }
#toast button { background: transparent; border-color: color-mix(in srgb, var(--bg) 40%, transparent); color: inherit; padding: 3px 10px; }

/* ---------- office ---------- */
:root {
  --o-grass: #c3e6a6; --o-road: #9aa0a8; --o-line: #f6f6f6; --o-sidewalk: #e9e3d7;
  --o-slab: #f8f5ef; --o-slab-l: #d9d2c4; --o-slab-r: #e6dfd2;
  --o-wall: #fcfbf8; --o-wall-side: #ece8e0; --o-wall-top: #d8d2c6;
  --o-desk: #ead5b4; --o-desk-l: #c9ab84; --o-desk-r: #d8bc95;
  --o-tree: #5cb36a; --o-tree-hi: #8fd18f; --o-screen: #9fd3ff;
  --o-sign: #ffffff; --o-sign-line: #e1ddd5; --o-text: #23252b;
  --o-rug: #e9c9a0; --o-sofa: #6f8fd8; --o-sofa-l: #4f6db6; --o-sofa-r: #5d7cc6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --o-grass: #263f28; --o-road: #3b3f46; --o-line: #8b8f96; --o-sidewalk: #46433c;
    --o-slab: #393731; --o-slab-l: #2a2925; --o-slab-r: #33312c;
    --o-wall: #4a4842; --o-wall-side: #3d3b36; --o-wall-top: #5a5750;
    --o-desk: #8b6f4e; --o-desk-l: #644e36; --o-desk-r: #765d41;
    --o-tree: #3f8a4a; --o-tree-hi: #5aa864; --o-screen: #5fb2ff;
    --o-sign: #23242a; --o-sign-line: #3a3c42; --o-text: #ececec;
    --o-rug: #6b5640; --o-sofa: #4a5f96; --o-sofa-l: #36477a; --o-sofa-r: #405388;
  }
}
.office { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.office-side { display: grid; gap: 12px; position: sticky; top: 74px; }
.office-main { display: grid; gap: 16px; min-width: 0; }
.greet h1 { font-family: var(--serif); font-weight: 400; font-size: 2.2rem; letter-spacing: -0.02em; margin: 0; line-height: 1.3; }
.greet p { margin: 8px 0 0; font-size: .88rem; color: var(--muted); }
.intake-btn { background: var(--lime); color: var(--lime-ink); border: 0; font-weight: 650; padding: 13px 16px; border-radius: 14px; font-size: .95rem; justify-content: space-between; box-shadow: 0 3px 10px rgb(22 23 27 / .14); }
.intake-btn:hover { background: var(--lime); filter: brightness(1.04); }
.chat-btn { justify-content: space-between; padding: 11px 14px; border-radius: 14px; font-weight: 580; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; box-shadow: var(--shadow-1); }
.stat b { font-size: 1.45rem; line-height: 1.3; font-weight: 650; letter-spacing: -0.02em; }
.stat span { font-size: .72rem; color: var(--muted); }
.stat.wide { grid-column: 1 / -1; }
.stat.st-running b { color: var(--accent); }
.stat.st-blocked b { color: var(--bad); }
.team ul { list-style: none; margin: 0; padding: 0; max-height: 44vh; overflow: auto; }
.team li { display: grid; grid-template-columns: 30px 1fr 10px; gap: 9px; align-items: center; padding: 5px 6px; border-radius: 9px; cursor: pointer; transition: background .15s; }
.team li:hover, .team li.sel { background: var(--surface-2); }
.team li strong { display: block; font-size: .82rem; line-height: 1.35; font-weight: 580; }
.team li small { display: block; color: var(--muted); font-size: .7rem; line-height: 1.35; }
.team svg, .selected svg, .stages svg, .chat-head svg, .inbox-item svg { border-radius: 50%; background: var(--surface-2); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); }
.dot.st-running, .dot.st-working { background: var(--accent); animation: pulse 1.6s infinite; }
.dot.st-blocked { background: var(--bad); }
.dot.st-assigned, .dot.st-waiting_review { background: var(--warn); }
.dot.st-available { background: var(--ok); }
.dot.st-chatting { background: var(--violet); }
.selected p { margin: 8px 0; }
.world-wrap { position: relative; }
.world-host { padding: 0; overflow: auto; background: var(--o-grass); max-height: 80vh; border-radius: 18px; }
.world { display: block; width: calc(100% * var(--zoom, 1)); height: auto; min-height: 420px; }
.world text { font: 600 11px/1 var(--font); fill: var(--o-text); }
.room-sign text { font-size: 11.5px; }
.zoom { position: absolute; right: 12px; bottom: 12px; display: grid; gap: 4px; }
.zoom button { width: 34px; height: 34px; padding: 0; background: var(--surface); box-shadow: var(--shadow-1); }
.agent, .walker { cursor: pointer; outline: none; }
.agent:focus-visible .person, .agent:hover .person, .walker:hover .body { filter: drop-shadow(0 0 3px var(--accent)); }
.agent.st-running .arms { animation: typing .28s ease-in-out infinite alternate; }
.agent.st-running .glow { opacity: .55; animation: screen 2.4s ease-in-out infinite; }
.agent.st-blocked .person { filter: drop-shadow(0 0 4px var(--bad)); }
.agent.away .person, .agent.away .glow { display: none; }
.walker.walking .leg-l { animation: step .3s ease-in-out infinite alternate; }
.walker.walking .leg-r { animation: step .3s ease-in-out infinite alternate-reverse; }
.walker.walking .arms { animation: swing .3s ease-in-out infinite alternate; }
.walker.st-chatting .body { filter: drop-shadow(0 0 4px var(--violet)); }
@keyframes typing { from { transform: translateY(0); } to { transform: translateY(-1.6px); } }
@keyframes screen { 50% { opacity: .3; } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes step { from { transform: translateY(0); } to { transform: translateY(-2.4px); } }
@keyframes swing { from { transform: translateY(-.6px); } to { transform: translateY(.8px); } }
.tag rect { fill: var(--o-sign); stroke: var(--o-sign-line); }
.tag text { font-size: 10.5px; }
.tag.st-running rect { fill: var(--accent); stroke: var(--accent); }
.tag.st-running text, .tag.st-blocked text, .tag.st-chatting text { fill: #fff; }
.tag.st-blocked rect { fill: var(--bad); stroke: var(--bad); }
.tag.st-chatting rect { fill: var(--violet); stroke: var(--violet); }
.tag.st-assigned rect, .tag.st-waiting_review rect { fill: var(--warn-soft); stroke: var(--warn); }
.tag.st-assigned text, .tag.st-waiting_review text { fill: var(--warn); }
.bubble rect, .bubble path { fill: var(--o-sign); stroke: var(--o-sign-line); }
.bubble text { font-size: 10px; font-weight: 600; }
.bubble.st-running rect, .bubble.st-running path { fill: var(--accent-soft); stroke: var(--accent); }
.bubble.st-running text { fill: var(--accent); }
.bubble.st-blocked rect, .bubble.st-blocked path { fill: var(--bad-soft); stroke: var(--bad); }
.bubble.st-blocked text { fill: var(--bad); }
.bubble.st-chatting rect, .bubble.st-chatting path { fill: color-mix(in srgb, var(--violet) 14%, var(--o-sign)); stroke: var(--violet); }
.bubble.st-chatting text { fill: var(--violet); }
.paper rect { fill: #fff; stroke: #c9c3b8; }
.paper path { stroke: #9aa3b5; stroke-width: 1.2; fill: none; }
.paper.landed { opacity: 0; transition: opacity .6s; }
.done-burst circle { fill: var(--ok); opacity: .92; }
.done-burst path { stroke: #fff; stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.done-burst { animation: rise 1.8s ease-out forwards; }
@keyframes rise { 0% { opacity: 0; } 15% { opacity: 1; } 70% { opacity: 1; } to { opacity: 0; } }
.ticker .log li { grid-template-columns: 120px 1fr; }

/* ---------- projects ---------- */
.project-list { display: grid; gap: 10px; }
.project-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) auto; gap: 18px; align-items: center; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); box-shadow: var(--shadow-1); transition: transform .2s var(--ease), box-shadow .2s; }
.project-row:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-2); }
.project-row h2 { margin: 0; }
.project-row .meta { font-size: .78rem; color: var(--muted); margin-top: 3px; }
.rail { display: flex; align-items: center; }
.rail span { flex: 1; height: 6px; background: var(--surface-2); margin-right: 3px; border-radius: 3px; }
.rail span.done { background: var(--ok); } .rail span.in_progress { background: var(--accent); animation: shimmer 1.6s ease-in-out infinite; } .rail span.blocked { background: var(--bad); } .rail span.assigned { background: var(--warn); }
@keyframes shimmer { 50% { opacity: .5; } }
.stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.stages > li { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
.stages > li:first-child { border-top: 0; }
.stage-body { display: grid; gap: 5px; }
.stages li.ss-null { opacity: .5; }
.stages li.ss-in_progress svg { box-shadow: 0 0 0 3px var(--accent); }
.stages li.ss-done svg { box-shadow: 0 0 0 3px var(--ok); }
.stages li.ss-blocked svg { box-shadow: 0 0 0 3px var(--bad); }
.error-text { color: var(--bad); font-size: .82rem; margin: 0; }
.small-print { font-size: .78rem; }
.wide-dialog { width: min(560px, calc(100vw - 32px)); }
.doc-dialog { width: min(860px, calc(100vw - 32px)); max-height: 86vh; }
.md { line-height: 1.65; max-width: 75ch; }
.md h2, .md h3, .md h4 { margin: 1.3em 0 .4em; }
.md pre { background: var(--surface-2); padding: 12px; border-radius: 10px; overflow: auto; }
.md table { margin: 8px 0; font-size: .85rem; }

/* settings & offices */
.settings { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.office-row { display: grid; grid-template-columns: minmax(0, 1fr) repeat(4, auto) auto; gap: 18px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.office-row:first-child { border-top: 0; }
.office-row .num { font-weight: 620; }
.office-row small { display: block; color: var(--muted); font-size: .72rem; }
.status-line { display: flex; gap: 8px; align-items: center; font-size: .86rem; flex-wrap: wrap; }
.skill-grid { display: grid; }
.skill-grid > div { display: grid; grid-template-columns: 170px 1fr; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); align-items: baseline; }
.skill-grid > div:first-child { border-top: 0; }

/* ---------- chat ---------- */
.chat-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--surface); border-left: 0; box-shadow: var(--shadow-2); display: grid; grid-template-rows: auto 1fr auto; z-index: 30; animation: panel-in .3s var(--ease); }
@keyframes panel-in { from { transform: translateX(24px); opacity: 0; } }
body.chat-open main { padding-right: min(444px, 24px + 100vw); }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chat-inbox { overflow: auto; padding: 8px; }
.inbox-item { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 10px; border: 0; border-radius: 12px; background: transparent; }
.inbox-item:hover { background: var(--surface-2); }
.inbox-item strong { font-size: .86rem; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inbox-item small { display: block; color: var(--muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 270px; }
.inbox-item .unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.help-flag { font-size: .66rem; font-weight: 650; color: var(--bad); background: var(--bad-soft); padding: 1px 7px; border-radius: 999px; }
.inbox-new { padding: 6px 10px 12px; display: grid; gap: 6px; }
.chat-thread { display: grid; grid-template-rows: auto 1fr auto auto; min-height: 0; }
.chat-help { margin: 10px 14px 0; padding: 11px 12px; border-radius: 12px; background: var(--bad-soft); color: var(--text); font-size: .82rem; display: grid; gap: 8px; }
.chat-help strong { color: var(--bad); display: flex; gap: 6px; align-items: center; }
.chat-log { overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 9px; min-height: 0; }
.msg { max-width: 88%; padding: 9px 13px; border-radius: 16px; font-size: .88rem; line-height: 1.5; animation: msg-in .3s var(--ease); }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }
.msg p { margin: 0 0 6px; } .msg p:last-child { margin: 0; }
.msg ul, .msg ol { margin: 4px 0; padding-left: 18px; }
.msg small { display: block; margin-top: 4px; font-size: .7rem; color: var(--muted); }
.msg.agent { background: var(--surface-2); align-self: flex-start; border-bottom-left-radius: 5px; }
.msg.human { background: var(--accent); color: var(--accent-ink); align-self: flex-end; border-bottom-right-radius: 5px; white-space: pre-wrap; }
.msg.error { background: var(--bad-soft); color: var(--bad); align-self: flex-start; }
.typing { display: flex; gap: 4px; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .25; } }
.chat-suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 8px; }
.chat-suggest button { border: 1px solid var(--line); border-radius: 999px; text-align: left; font-weight: 500; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); align-items: end; }
.chat-foot { padding: 0 14px 10px; font-size: .72rem; margin: 0; }

@media (max-width: 1240px) { .exec-chip { display: none; } }
@media (max-width: 1000px) {
  .office { grid-template-columns: 1fr; }
  .office-side { position: static; }
  .office-main { order: -1; }
  .team ul { max-height: 260px; }
  .world { min-height: 0; width: calc(160% * var(--zoom, 1)); }
  .login { grid-template-columns: 1fr; }
  .login-art { min-height: 240px; padding: 28px; }
  .project-row { grid-template-columns: 1fr; }
  .office-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .top { padding: 10px 16px; gap: 10px; }
  .tabs { flex-basis: 100%; order: 3; overflow-x: auto; flex-wrap: nowrap; }
  .exec-chip { display: none; }
  main { padding: 16px 16px 56px; }
  .grid.two, .grid.three, .settings { grid-template-columns: 1fr; }
  .log li { grid-template-columns: 1fr; gap: 0; }
  body.chat-open main { padding-right: 16px; }
  .skill-grid > div { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.form label.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: .84rem; }
details summary { cursor: pointer; margin: 6px 0; }
details ol { margin: 6px 0 12px; padding-left: 18px; display: grid; gap: 4px; }
.msg-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
