/* Obsidian Matte — Rust MCP Hub Web UI */
:root {
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  --ink: #08090b;
  --panel: #111215;
  --panel-2: #1e2023;
  --raised: #26282c;
  --rim: #2f3136;
  --rim-2: #47484c;
  --text: #f4f5f7;
  --dim: #8e9299;
  --faint: #5c6068;
  --green: #71d7a4;
  --green-ink: #15241c;
  --honey: #eac180;
  --red: #ff8a80;
  --radius: 12px;
  --nav-w: 264px;
  --bridges-w: 220px;
}
* { box-sizing: border-box }
[hidden] { display: none !important }
html, body { height: 100% }
body { margin: 0; height: 100dvh; background: var(--ink); color: var(--text); overflow: hidden; -webkit-font-smoothing: antialiased }
button, textarea, input { font: inherit; color: inherit }
button { cursor: pointer }
button:disabled { opacity: .45; cursor: default }
button, input, textarea { border: 1px solid var(--rim); border-radius: 8px; background: #0e0e12 }
button { min-height: 34px; padding: 0 12px; transition: background-color .12s, border-color .12s, color .12s }
button:hover:enabled { background-color: var(--raised); border-color: var(--rim-2) }
:focus-visible { outline: 2px solid #d8d8e2; outline-offset: 2px }
input:focus-visible, textarea:focus-visible { outline: 0; border-color: #4a4a57; box-shadow: 0 0 0 3px #ffffff0d }
input, textarea { width: 100%; padding: 9px 11px }
input::placeholder, textarea::placeholder { color: var(--faint) }
h1, h2, p { margin: 0 }
small { color: var(--dim); font-size: .8rem }
::-webkit-scrollbar { width: 10px; height: 10px }
::-webkit-scrollbar-thumb { background: #26262e; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box }
::-webkit-scrollbar-track { background: transparent }
.icon { min-width: 34px; padding: 0; font-size: 1.05rem; display: inline-grid; place-items: center }
.primary { color: #0d0d10; background: #f2f2f5; border-color: #f2f2f5; font-weight: 650 }
.primary:hover:enabled { background: #ffffff; border-color: #ffffff }
.secondary { background: var(--panel-2) }
.ghost { background: transparent; border-color: transparent; color: var(--dim) }
.ghost:hover:enabled { color: var(--text) }
.pill { border-radius: 6px; font-size: .78rem; padding: 0 11px; white-space: nowrap }
button[aria-pressed=true] { color: var(--green); border-color: #3c5a4b; background: var(--green-ink) }

/* Login */
.login { display: grid; place-items: center; height: 100%; padding: 20px; background: var(--ink) }
.login-card { width: min(100%, 372px); display: grid; gap: 12px; padding: 28px; background: var(--panel); border: 1px solid var(--rim); border-radius: 12px }
.login-card h1 { font-size: 1.25rem }
.login-card p, .login-card label { color: var(--dim); font-size: .9rem; line-height: 1.5 }
.login-card input { min-height: 44px; font-size: 1rem; letter-spacing: .04em }
.login-card button { margin-top: 4px; min-height: 44px }
#login-status { min-height: 1.2em; color: var(--honey); line-height: 1.45 }
.mark { display: grid; place-items: center; background: var(--raised); border: 1px solid var(--rim-2); border-radius: 8px; width: 30px; height: 30px; color: var(--honey); font-size: 18px; flex: none }

/* Shell */
.shell { height: 100%; display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr) var(--bridges-w); gap: 8px; padding: 8px; transition: grid-template-columns .18s ease }
.shell.nav-collapsed { grid-template-columns: 0 minmax(0, 1fr) var(--bridges-w); gap: 0 8px }
.shell.nav-collapsed .sidebar { visibility: hidden; border-width: 0; padding: 0 }
.shell.nav-collapsed #nav-toggle { display: inline-grid }
.sidebar, .canvas, .bridges { min-height: 0; min-width: 0; border: 1px solid var(--rim); border-radius: 12px; overflow: hidden }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; background: var(--panel); padding: 12px; gap: 12px }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; min-width: 0 }
.brand-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.brand-sub { font-size: .8em; font-weight: 500; opacity: .5; margin-left: 2px }
.brand-icon { display: block; width: 20px; height: 20px; object-fit: contain }
#nav-collapse { min-height: 30px; min-width: 30px; font-size: .95rem }
.chat-tools { display: flex; gap: 6px }
#filter { min-width: 0; min-height: 34px; padding: 6px 10px; background: var(--ink) }
#chats { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; padding: 0 4px }
.chat-row { position: relative; display: flex; align-items: center; min-width: 0; border-radius: 8px }
.chat-row.branch { margin-left: 12px; border-left: 1px solid var(--rim-2); border-radius: 0 9px 9px 0 }
.chat-row:hover { background: #ffffff08 }
.chat-row[aria-current=true] { background: #1c2621; box-shadow: inset 2px 0 var(--green) }
.row { flex: 1; display: block; min-width: 0; text-align: left; min-height: 36px; padding: 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: transparent; border-color: transparent; font-size: .9rem }
.row:hover:enabled { background: transparent; border-color: transparent }
.row.branch { margin: 0; border: 0 }
.row-actions { display: flex; gap: 2px; padding-right: 4px; opacity: 0; transition: opacity .12s }
.chat-row:hover .row-actions, .chat-row:focus-within .row-actions, .chat-row[aria-current=true] .row-actions { opacity: 1 }
.row-act { min-height: 26px; min-width: 26px; padding: 0; border-color: transparent; background: transparent; color: var(--dim); font-size: .85rem; display: grid; place-items: center }
.row-act:hover:enabled { color: var(--text); background: #ffffff10; border-color: transparent }
.row-act.danger:hover:enabled { color: var(--red); background: #ff8a8014 }
.rename-input { min-height: 34px; padding: 5px 9px; border-color: #3c5a4b; background: var(--ink); font-size: .9rem }
.rename-input:focus-visible { border-color: #4f7a64; box-shadow: 0 0 0 3px #71d7a414 }
.group { margin: 10px 0 3px; color: var(--faint); font-size: .74rem; letter-spacing: .04em; text-transform: uppercase; padding-left: 8px }
#chats > small { padding: 10px 8px }
#sign-out { min-height: 34px; font-size: .82rem; color: var(--dim) }

/* Canvas */
.canvas { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; background: var(--ink); position: relative }
.canvas > .top { grid-row: 1 }
.canvas > .chat-search { grid-row: 2 }
.canvas > .scroll { grid-row: 3 }
.canvas > .dock { grid-row: 4 }
.top { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 56px; border-bottom: 1px solid var(--rim); background: var(--panel); padding: 8px 12px }
.chat-title { min-width: 0; flex: 1; display: grid; gap: 1px }
.top h1 { font-size: .98rem; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.top small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .75rem }
.top-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0 }
.connection { font-size: .76rem; color: var(--dim); white-space: nowrap; padding: 0 4px }
.connection::before { display: inline-block; content: ""; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--honey) }
.connection[data-online=true]::before { background: var(--green) }
.connection[data-online=true][data-agent=none]::before { background: var(--faint); box-shadow: none }
.connection[data-online=true][data-agent=none] { color: var(--faint) }
.connection[data-online=false][data-agent=offline]::before { background: var(--red) }
.connection[data-copy=true] { cursor: copy }
#nav-toggle, .nav-shade { display: none }
.chat-search { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--panel); border-bottom: 1px solid var(--rim) }
.chat-search input { min-width: 0; flex: 1; min-height: 32px; padding: 5px 10px; background: var(--ink) }
.chat-search span { min-width: 22px; color: var(--dim); font-size: .8rem }
.scroll { overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable }

/* Feed */
.feed { width: min(100%, 780px); padding: 20px clamp(10px, 3vw, 28px) 22px; margin-inline: auto; display: flex; flex-direction: column; gap: 12px; min-height: 100% }
.bubble { overflow-wrap: anywhere; width: min(100%, 72ch); font-size: .95rem; line-height: 1.58 }
.bubble:not(.operator) { background: var(--panel); border: 1px solid var(--rim); border-radius: 12px; padding: 12px 15px }
.bubble.operator { align-self: end; background: var(--raised); border: 1px solid var(--rim-2); border-radius: 16px 16px 4px 16px; padding: 10px 14px; max-width: 76%; width: auto }
.bubble header { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; font-size: .8rem; font-weight: 650; color: var(--dim) }
.bubble time { margin-left: auto; font-size: .72rem; font-weight: 400; color: var(--faint) }
.bubble p { white-space: pre-wrap; margin: .25em 0 }
.bubble a { color: #c9d3fb }
.bubble ul, .bubble ol { padding-left: 1.3em; margin: .3em 0 }
.bubble h1, .bubble h2, .bubble h3 { font-size: 1rem; margin: .5em 0 .25em }
.message-footer { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: .72rem; margin-top: 8px }
.message-footer time { margin: 0 }
.bubble.operator .message-footer { justify-content: flex-end }
.source-tag { border: 1px solid var(--rim-2); border-radius: 6px; padding: 1px 7px }
.copy-message { min-height: 24px; padding: 2px 6px; border: 0; background: transparent; color: var(--faint); font-size: .72rem }
.copy-message:hover:enabled { color: var(--text); background: #ffffff0d }
.relay { padding: 2px 8px; margin-bottom: 6px; border-left: 2px solid var(--honey); color: var(--honey); font-size: .8rem }
.sphere { width: 18px; height: 18px; border-radius: 50%; border: 1px solid #e6e6ea; background: radial-gradient(circle, #b1b1ba, #242429 65%); flex: none }
.empty { margin: auto; text-align: center; display: grid; justify-items: center; gap: 13px; padding: 38px 0; color: var(--dim) }
.empty .sphere { width: 84px; height: 84px; background: repeating-radial-gradient(ellipse at 55% 30%, #ccccd810 0 6px, #e8e8f870 7px, transparent 8px 13px), radial-gradient(circle, #3c3c45, #121216 66%) }
.empty-actions { display: grid; width: min(260px, 100%); gap: 8px }
.feed-loading { min-height: 40vh }
pre, code { font-family: "Cascadia Code", Consolas, monospace }
pre { margin: 6px 0 0; max-height: 400px; padding: 10px; overflow: auto; border: 1px solid var(--rim); background: #08080b; border-radius: 8px }
code { font-size: .84em; overflow-wrap: anywhere }
.bubble p code { background: #24242c; padding: 1px 5px; border-radius: 4px }
.code-card { margin: 9px 0; border: 1px solid var(--rim); border-radius: 8px; background: #08080b; overflow: hidden }
.code-header { display: flex; align-items: center; justify-content: space-between; padding: 5px 8px; color: var(--dim); font: 12px Consolas, monospace; border-bottom: 1px solid var(--rim); background: var(--panel) }
.code-header button { min-height: 26px; padding: 2px 8px; font-size: .74rem }
.code-card pre { margin: 0; border: 0; border-radius: 0 }
.code-line { display: block; min-height: 1.45em; white-space: pre }
.code-line::before { content: attr(data-line); display: inline-block; width: 3em; padding-right: 10px; margin-right: 10px; color: #55555e; text-align: right; user-select: none; position: sticky; left: 0; background: #08080b }
.syntax-comment { color: #7d8590; font-style: italic }
.syntax-string { color: #a5d6ff }
.syntax-number { color: #79c0ff }
.syntax-keyword { color: #ff7b72 }
.file-download { display: inline-block; max-width: 100%; min-height: 32px; padding: 4px 10px; color: #ccebd9; background: var(--green-ink); border-color: #3c5a4b; text-align: left; overflow-wrap: anywhere }
.file-card { display: flex; align-items: center; gap: 10px; min-width: 0; width: min(100%, 500px); padding: 9px; margin: 8px 0; border: 1px solid var(--rim-2); border-radius: 12px; background: var(--panel-2) }
.file-card-icon { width: 32px; height: 32px; display: grid; place-items: center; background: var(--raised); border: 1px solid var(--rim); border-radius: 8px; flex: none }
.file-card-info { display: grid; gap: 2px; min-width: 0; flex: 1 }
.file-card-info strong, .file-card-info small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.file-card-info small { color: var(--dim); font-size: .7rem }
.file-card-action { flex: none; color: #0d0d10; background: #ececf1; border-color: #ececf1; font-weight: 600 }
.file-card-action:hover:enabled { background: #fff; border-color: #fff }
.attachment { border: 0; background: none; padding: 0; display: block }
.attachment img { max-width: 100%; max-height: 340px; border-radius: 8px; display: block; border: 1px solid var(--rim) }

/* Agent steps */
.activity, .plan { border: 1px solid var(--rim); border-radius: 12px; padding: 9px 12px; background: var(--panel); font-size: .85rem }
summary { cursor: pointer; color: var(--text); padding-block: 3px }
.thought { border-color: #2f3f37; background: #111915 }
.thought summary { color: #a9d9bd; font-weight: 600 }
.activity ul, .plan ol { margin: 7px 0 0; padding-left: 20px; color: var(--dim) }
.plan [data-done=true] { text-decoration: line-through; color: var(--faint) }
.plan [data-current=true] { color: var(--text) }
.steps-group { width: min(100%, 72ch); padding: 7px 10px }
.steps-group > summary, .step > summary { display: flex; align-items: center; gap: 9px; min-width: 0; list-style: none }
.steps-group > summary::-webkit-details-marker, .step > summary::-webkit-details-marker { display: none }
.steps-group > summary::after { content: ""; color: var(--faint); font-size: .75rem; -webkit-mask-image: var(--i-chevron-right); mask-image: var(--i-chevron-right); transition: transform .15s }
.steps-group[open] > summary::after { transform: rotate(90deg) }
.activity-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim) }
.activity-time, .step-detail { color: var(--faint); font: 12px Consolas, monospace; white-space: nowrap }
.step-time { flex: none; color: var(--faint); font: 12px var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap }
.step-time.long { color: var(--honey) }
.done-mark { width: 18px; height: 18px; display: grid; place-items: center; flex: none; border-radius: 50%; background: var(--green-ink); color: var(--green); font-size: .7rem }
.live-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--honey) }
.steps-list { padding: 6px 0 0 2px; max-height: 420px; overflow: auto }
.step { margin: 1px 0 }
.step > summary { padding: 4px; border-radius: 8px }
.step > summary:hover { background: #ffffff08 }
.step-icon { width: 22px; height: 22px; display: grid; place-items: center; flex: none; border-radius: 6px; background: var(--raised); border: 1px solid var(--rim) }
.step-title { max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.step-detail { flex: 1; overflow: hidden; text-overflow: ellipsis }
.step-output { margin: 5px 0 6px 31px; max-height: 260px }
.step-output span { display: block; white-space: pre }
.line-add { color: #7ee787; background: #0f2417 }
.line-del { color: #ff8a80; background: #2a1215 }
progress { width: 100%; height: 6px; accent-color: #e5e5e8 }

/* Dock and composer */
.dock { width: min(100%, 780px); margin-inline: auto; padding: 0 clamp(8px, 3vw, 26px) 10px; position: relative }
.jump { position: absolute; bottom: calc(100% + 14px); left: 50%; transform: translateX(-50%); border-radius: 12px; background: var(--raised); box-shadow: 0 6px 20px #0009; z-index: 2 }
.queue { color: var(--honey); font-size: .8rem; margin: 0 0 6px 4px }
.queue summary { cursor: pointer; width: fit-content; color: var(--honey) }
.queue-list { position: absolute; bottom: calc(100% + 8px); left: clamp(8px, 3vw, 26px); right: clamp(8px, 3vw, 26px); max-height: min(40vh, 260px); overflow: auto; z-index: 3; padding: 10px 14px; border: 1px solid var(--rim-2); border-radius: 12px; background: var(--panel); color: var(--text); box-shadow: 0 10px 30px #000a }
.queue-list p { margin: 0 0 6px }
.queue-status { color: var(--dim); font-size: .78rem }
.queue-steps { margin: 0; padding-left: 1.5em; overflow-wrap: anywhere; white-space: pre-wrap }
.queue-steps li + li { margin-top: 6px }
.queue-body { display: block }
.queue-actions { display: flex; gap: 4px; margin-top: 4px }
.queue-controls { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px }
.queue-controls .chip { min-height: 30px; padding: 0 11px }
.queue-controls .chip[aria-pressed=true] { color: #71D7A4; border-color: rgba(113, 215, 164, .35) }
.queue-controls .chip.warn { color: #EAC180; border-color: rgba(234, 193, 128, .35) }
.queue-actions button { min-width: 30px; min-height: 28px; padding: 0 8px; font-size: .78rem }
.composer { display: flex; flex-direction: column; border: 1px solid var(--rim-2); border-radius: 12px; background: var(--panel); overflow: visible; transition: box-shadow .16s, border-color .16s }
.composer:focus-within { border-color: #3d3d48; box-shadow: 0 0 0 3px #ffffff08 }
.composer textarea { resize: none; min-width: 0; min-height: 60px; max-height: 38dvh; background: transparent; border: 0; padding: 12px 14px 4px; line-height: 1.5 }
.composer textarea:focus-visible { outline: 0 }
.compose-tools { display: flex; align-items: center; gap: 6px; padding: 0 8px 7px }
.compose-tools button { min-height: 30px }
.compose-tools .icon { min-width: 30px }
.skills-toggle { border-radius: 6px; font-size: .78rem; padding: 0 11px; color: var(--dim) }
.skills-toggle[aria-expanded=true] { color: var(--text); border-color: #3d3d48 }
.compose-footer { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 12px; background: #0d0d11; border-top: 1px solid var(--rim); border-radius: 0 0 15px 15px; min-width: 0 }
.workspace-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--faint); font-size: .74rem }
.access-menu { position: relative; min-width: 0 }
.auto-loop { display: inline-flex; align-items: center; gap: .3rem; color: var(--faint); font-size: .74rem; white-space: nowrap; cursor: pointer }
.auto-loop input { margin: 0 }
.access-menu summary { display: grid; place-items: center; cursor: pointer; list-style: none; min-height: 30px; max-width: 140px; padding: 0 10px; border: 1px solid var(--rim); border-radius: 6px; background: var(--panel-2); font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.access-menu summary::-webkit-details-marker { display: none }
.access-options { position: absolute; z-index: 4; right: 0; bottom: calc(100% + 8px); width: min(270px, 85vw); padding: 12px; display: grid; gap: 12px; background: var(--panel); border: 1px solid var(--rim-2); border-radius: 12px; box-shadow: 0 10px 30px #000a }
.access-options label { display: flex; gap: 8px; align-items: center; font-size: .85rem }
.access-options input { width: auto; margin: 0; accent-color: var(--green) }
.send { display: flex; align-items: center; gap: 4px; flex: none }
.send .icon { width: 32px; min-width: 32px; height: 32px; min-height: 32px; border-radius: 50% }
.send .pill { min-height: 30px }
.draft-files { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 10px 0 }
.draft-files:empty { display: none }
.draft-chip { min-height: 26px; max-width: 220px; padding: 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .74rem; border-radius: 6px; background: var(--raised); border-color: var(--rim-2) }
.draft-chip:hover:enabled { border-color: #5a2f2f; color: var(--red) }
#feedback { min-height: 15px; margin-top: 4px; padding-left: 4px; font-size: .75rem; color: var(--honey) }
.upload-retry { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; padding: 6px 8px 6px 12px; border: 1px solid var(--rim-2); border-radius: 6px; background: var(--panel); font-size: .8rem }
.upload-retry button { min-height: 28px; font-size: .76rem; border-radius: 6px }
.upload-retry #upload-name { flex: 1 1 120px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.upload-retry #upload-name::before { content: ""; margin-inline-end: .35em; -webkit-mask-image: var(--i-paperclip); mask-image: var(--i-paperclip) }
.upload-retry progress { flex: 0 1 140px; width: min(140px, 40%) }

/* Skills popover */
/* Stacking tiers: canvas 0-1, panel sheet 4, overlay popover 5 (one at a time, see claimOverlay), mobile drawer 6-7, code sheet 8, dock nav 9, menus 30, palette 90, toast 95. */
body[data-overlay="skills"] .feed { visibility: hidden }
.skills-popover { position: absolute; z-index: 5; left: clamp(8px, 3vw, 26px); bottom: calc(100% - 2px); width: min(440px, calc(100% - 2 * clamp(8px, 3vw, 26px))); max-height: min(62dvh, 520px); display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--panel); border: 1px solid var(--rim-2); border-radius: 12px; box-shadow: 0 18px 50px #000c }
.skills-head { display: flex; align-items: center; gap: 8px }
.skills-head strong { font-size: .92rem }
.skills-head small { flex: 1; color: var(--faint); font-size: .74rem }
.skills-head .icon { min-height: 28px; min-width: 28px }
#skills-filter { min-height: 32px; padding: 5px 10px; background: var(--ink) }
.skills-list { flex: 1; min-height: 60px; overflow: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; padding: 0 4px }
.skill-item { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 4px 6px; border-radius: 8px }
.skill-item:hover { background: #ffffff08 }
.skill-item.off .skill-info strong { color: var(--dim) }
.skill-toggle { appearance: none; -webkit-appearance: none; flex: none; width: 30px; height: 18px; margin: 0; padding: 0; border-radius: 999px; background: #2a2a33; border: 1px solid var(--rim-2); position: relative; cursor: pointer; transition: background .15s }
.skill-toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #9b9ba8; transition: transform .15s, background .15s }
.skill-toggle:checked { background: #24563f; border-color: #3c7a5c }
.skill-toggle:checked::after { transform: translateX(12px); background: #e9fff3 }
.skill-info { flex: 1; min-width: 0; display: grid; gap: 1px; text-align: left; padding: 3px 4px; border: 0; background: transparent; min-height: 0 }
.skill-info:hover:enabled { background: transparent }
.skill-info strong { font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.skill-info small { font-size: .74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.skill-source { flex: none; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--faint); font-size: .68rem; border: 1px solid var(--rim); border-radius: 6px; padding: 1px 7px }
.skill-source:empty { display: none }
.skills-empty { padding: 8px }
.skill-import { display: flex; gap: 6px; padding-top: 8px; border-top: 1px solid var(--rim) }
.skill-import input { min-width: 0; min-height: 32px; padding: 5px 10px; background: var(--ink); font-size: .82rem }
.skill-import button { min-height: 32px; font-size: .8rem; flex: none }
.skills-status { min-height: 1em; font-size: .74rem; color: var(--honey) }
.skills-status:empty { display: none }

/* Bridges */
.bridges { background: var(--panel); padding: 13px; overflow: auto }
.bridges h2 { font-size: .88rem; margin-bottom: 10px; color: var(--dim); font-weight: 600 }
.mobile-previews { display: none }
.preview { margin-bottom: 12px; padding: 8px; border: 1px solid var(--rim); border-radius: 8px; background: var(--panel-2); font-size: .84rem }
.preview h3 { margin: 0 0 6px; font-size: .82rem }
.preview img { width: 100%; aspect-ratio: 220 / 128; object-fit: contain; border-radius: 6px; background: var(--ink) }
.preview button { border: 0; background: none; padding: 0; display: block; width: 100% }
dialog { max-width: 94vw; max-height: 92dvh; padding: 10px; background: var(--panel); color: var(--text); border: 1px solid var(--rim-2); border-radius: 12px }
dialog::backdrop { background: #000c }
dialog img { display: block; max-width: 88vw; max-height: 78dvh; margin-top: 8px; object-fit: contain; border-radius: 8px }

/* Wide monitors */
@media (min-width: 1600px) {
  :root { --nav-w: 288px; --bridges-w: 250px }
  .feed, .dock { width: min(100%, 860px) }
}
/* Tablet */
@media (max-width: 1100px) { :root { --nav-w: 232px; --bridges-w: 190px } }
@media (max-width: 920px) {
  .shell, .shell.nav-collapsed { grid-template-columns: var(--nav-w) minmax(0, 1fr) }
  .shell.nav-collapsed { grid-template-columns: 0 minmax(0, 1fr) }
  .bridges { display: none }
  .mobile-previews { display: block; margin: 8px 10px 0; padding: 5px 9px; border: 1px solid var(--rim); border-radius: 8px; font-size: .8rem; background: var(--panel) }
  .mobile-previews button { display: inline-block; margin: 4px; padding: 0; border: 0; background: none }
  .mobile-previews img { max-width: 160px; border-radius: 6px }
}
/* Phone and phone landscape */
@media (max-width: 768px), (max-height: 500px) and (orientation: landscape) and (max-width: 960px) {
  .shell, .shell.nav-collapsed { display: block; padding: 0 }
  .shell.nav-collapsed .sidebar { visibility: visible; border-width: 1px; padding: 12px }
  .canvas { height: 100%; border: 0; border-radius: 0 }
  .sidebar { position: fixed; inset: 6px auto 6px 6px; width: min(292px, 86vw); z-index: 7; display: none; box-shadow: 0 20px 60px #000c }
  .sidebar.open { display: flex }
  .row-actions { opacity: 1 }
  .row-act { min-height: 34px; min-width: 34px }
  .nav-shade { display: block; position: fixed; inset: 0; width: 100%; z-index: 6; background: #000b; border: 0; border-radius: 0 }
  #nav-toggle, .shell.nav-collapsed #nav-toggle { display: inline-grid }
  .top { padding: 6px 8px; gap: 6px; min-height: 52px }
  .top-actions { gap: 4px }
  .connection { font-size: 0; padding: 0 2px }
  .connection::before { margin-right: 0; vertical-align: middle }
  .icon, .top-actions button { min-height: 44px; min-width: 44px }
  .top-actions .secondary { padding: 0 10px }
  .dock { padding: 0 6px max(6px, env(safe-area-inset-bottom)) }
  .feed { padding: 12px 10px 16px }
  .bubble { font-size: .93rem }
  .bubble:not(.operator) { padding: 10px 12px }
  .bubble.operator { max-width: 86% }
  .skills-popover { left: 6px; right: 6px; width: auto; max-height: 58dvh }
  .composer textarea { min-height: 52px; padding: 10px 12px 4px; font-size: 16px }
  .top { padding-top: max(6px, env(safe-area-inset-top)) }
  .sidebar { inset: max(6px, env(safe-area-inset-top)) auto max(6px, env(safe-area-inset-bottom)) 6px }
  .compose-tools button, .send .pill, .access-menu summary, #sign-out { min-height: 44px }
  .compose-tools .icon { min-width: 44px }
  .send { gap: 6px }
  .send .icon { width: 44px; min-width: 44px; height: 44px; min-height: 44px }
  .login { padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)) }
  .login input { font-size: 16px; min-height: 44px }
  .login button { min-height: 44px }
}
/* Narrow phone (360px) */
@media (max-width: 400px) {
  .top { flex-wrap: wrap }
  .chat-title { flex: 1 1 0 }
  .top-actions { flex: 1 0 100%; justify-content: flex-end }
  .connection { margin-right: auto; font-size: .74rem }
  .connection::before { margin-right: 6px }
  .workspace-name { display: none }
  .compose-footer { padding-left: 6px }
  .access-menu summary { max-width: 124px; padding: 0 8px; font-size: .7rem }
  .send .pill { padding: 0 8px; font-size: .72rem }
  .file-card { gap: 6px }
  .file-card-action { font-size: .73rem; padding: 0 8px }
  .skill-source { display: none }
  .upload-retry { border-radius: 12px }
}
/* Landscape phones and short windows */
@media (max-height: 500px) and (orientation: landscape) {
  .top { min-height: 44px; padding-block: 4px }
  .top small { display: none }
  .icon, .top-actions button { min-height: 34px; min-width: 34px }
  .feed { padding-block: 8px }
  .composer textarea { min-height: 40px; max-height: 30dvh; padding-top: 8px }
  .compose-tools { padding-bottom: 4px }
  .compose-footer { padding-block: 4px }
  .skills-popover { max-height: 72dvh }
  .skills-list { min-height: 40px }
}
@media (max-height: 400px) {
  .upload-retry { position: absolute; bottom: calc(100% + 6px); left: clamp(8px, 3vw, 26px); right: clamp(8px, 3vw, 26px); z-index: 4; margin: 0; flex-wrap: nowrap }
  .upload-retry button { flex-shrink: 0; white-space: nowrap }
}
@media (hover: none) { .row-actions { opacity: 1 } }
@media (prefers-reduced-motion: reduce) {
  .radial-wheel, .radial-toast.show { animation: none !important }
  .radial-sector, .radial-slot, .radial-pill, .radial-pill-name { transition: none !important; animation: none !important }
  *, *::before, *::after { transition: none !important }
  .feed > *, .task-bar, .plan-bar, .panel-sheet, .sidebar.open, .nav-shade, .task-spinner { animation: none !important }
  .chip:active, .dock-nav button:active, .rail-button:active, .task-stop:active, .send .icon:active { transform: none }
}

/* ===== Desktop parity: Obsidian Matte palette, 5-section rail, wallpaper, attachments, plan bar ===== */
:root {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ink: #0D0F12;
  --panel: #14171D;
  --panel-2: #171A21;
  --raised: #1B2028;
  --rim: #222731;
  --rim-2: #2C323D;
  --code-width: 380px;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --rail-w: 56px;
}
/* Pure OLED (the single theme switch lives in Settings) */
:root[data-theme="oled"] { --ink: #000000; --panel: #000000; --panel-2: #050506; --raised: #0b0b0d; --rim: #17171c; --rim-2: #222229 }
pre, code, .code-header, .activity-time, .step-detail, .files-path input { font-family: var(--mono) }

.shell { grid-template-columns: var(--rail-w) var(--nav-w) minmax(0, 1fr) var(--code-width) }
.shell.nav-collapsed { grid-template-columns: var(--rail-w) 0 minmax(0, 1fr) var(--code-width) }
.shell.code-collapsed { grid-template-columns: var(--rail-w) var(--nav-w) minmax(0, 1fr) 0 }
.shell.nav-collapsed.code-collapsed { grid-template-columns: var(--rail-w) 0 minmax(0, 1fr) 0 }
.shell.code-collapsed .code-panel { visibility: hidden; border-width: 0 }
.shell.code-resizing { transition: none; user-select: none; cursor: col-resize }
.rail { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 0; padding: 10px 0; background: var(--panel); border: 1px solid var(--rim); border-radius: 12px }
.rail-logo { margin-bottom: 10px }
.rail-button, .dock-nav button { position: relative; display: grid; place-items: center; padding: 0; color: var(--dim); background: transparent; border-color: transparent }
.rail-button { width: 40px; height: 40px; min-height: 40px; border-radius: 8px }
.rail-button svg, .dock-nav svg { width: 19px; height: 19px }
.rail-button:hover:enabled, .dock-nav button:hover:enabled { color: var(--text); background: #ffffff0a; border-color: transparent }
.rail-button[aria-current=true] { color: var(--text); background: var(--raised); border-color: var(--rim-2) }
.rail-button[aria-current=true]::before { content: ''; position: absolute; left: -9px; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: var(--green) }
.rail-button[data-panel=settings] { margin-top: auto }
.rail-button[data-count]:not([data-count='0'])::after, .dock-nav button[data-count]:not([data-count='0'])::after { content: attr(data-count); position: absolute; top: 3px; right: 3px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 999px; background: var(--honey); color: #1a1206; font: 700 .6rem/15px var(--mono) }
.dock-nav { display: none }

.canvas { grid-template-rows: auto auto auto auto minmax(0, 1fr) auto auto; grid-template-columns: minmax(0, 1fr); isolation: isolate }
.canvas > * { grid-column: 1; min-width: 0 }
.canvas > :not(.wallpaper) { position: relative; z-index: 1 }
.canvas > .task-bar { grid-row: 3 }
.canvas > .plan-bar { grid-row: 4 }
.canvas > .scroll { grid-row: 5 }
.canvas > .dock { grid-row: 6 }
.canvas > .dock-nav { grid-row: 7 }
.canvas > .panel-sheet { grid-row: 2 / 7; grid-column: 1; z-index: 4 }

/* Custom wallpaper from the desktop app */
.wallpaper { position: absolute; inset: 0; z-index: 0; pointer-events: none; background-position: center; background-size: var(--wp-size, cover); background-repeat: var(--wp-repeat, no-repeat); filter: var(--wp-filter, none) }
.wallpaper::after { content: ''; position: absolute; inset: 0; background: #000; opacity: var(--wp-dim, .68) }
.has-wallpaper .canvas > .scroll { background: transparent }
.has-wallpaper .top, .has-wallpaper .chat-search, .has-wallpaper .task-bar, .has-wallpaper .plan-bar { background: color-mix(in srgb, var(--panel) 78%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px) }
.has-wallpaper .bubble:not(.operator), .has-wallpaper .activity, .has-wallpaper .composer, .has-wallpaper .file-card { background: color-mix(in srgb, var(--panel) 86%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px) }
.has-wallpaper .bubble.operator { background: color-mix(in srgb, var(--raised) 90%, transparent) }

/* Active task bar: the only Stop control; the chevron folds it to one line */
.task-bar { display: grid; grid-template-columns: 24px 10px minmax(0, 1fr) 7ch auto; align-items: center; column-gap: 8px; padding: 3px 10px 3px 6px; background: var(--panel); border-bottom: 1px solid var(--rim); font-size: .8rem }
.task-toggle { min-width: 24px; min-height: 24px; width: 24px; padding: 0; color: var(--faint); font-size: .8rem }
.task-spinner { width: 9px; height: 9px; border-radius: 50%; background: var(--honey); animation: task-pulse 1.4s ease-in-out infinite }
@keyframes task-pulse { 50% { opacity: .35 } }
.task-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text) }
.task-time { color: var(--faint); font: .72rem var(--mono, monospace); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; min-width: 7ch }
.task-stop { min-height: 26px; padding: 0 10px; border-radius: 6px; border-color: #5a2f2f; color: var(--red); font-size: .74rem; white-space: nowrap }
.task-detail { grid-column: 3 / -1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--faint); font: .72rem var(--mono, monospace) }
.task-detail:empty, .task-bar[data-collapsed=true] .task-detail { display: none }
.task-bar[data-collapsed=true] { padding-block: 1px }

/* Collapsible plan bar on top of the chat */
.plan-bar { border-bottom: 1px solid var(--rim); background: var(--panel); padding: 0 14px; font-size: .84rem }
.plan-bar > summary { display: flex; align-items: center; gap: 10px; min-height: 40px; list-style: none; cursor: pointer; border-radius: 8px }
.plan-bar > summary:hover { background: color-mix(in srgb, var(--raised) 60%, transparent) }
.plan-bar > summary::-webkit-details-marker { display: none }
.plan-bar > summary::marker { content: '' }
/* Clean list glyph: three dots + three bars drawn with gradients, no font fallback */
.plan-icon { flex: none; width: 14px; height: 12px; background:
  radial-gradient(circle, var(--text) 1.2px, transparent 1.6px) 0 0 / 4px 4px repeat-y,
  linear-gradient(var(--text), var(--text)) 5px 1px / 9px 1.5px no-repeat,
  linear-gradient(var(--text), var(--text)) 5px 5px / 9px 1.5px no-repeat,
  linear-gradient(var(--text), var(--text)) 5px 9px / 9px 1.5px no-repeat; opacity: .85 }
.plan-count { flex: none; color: var(--dim); font: .74rem var(--mono, monospace); font-variant-numeric: tabular-nums; white-space: nowrap }
.plan-chevron { flex: none; width: 7px; height: 7px; margin: 0 4px 3px; border-right: 1.5px solid var(--faint); border-bottom: 1.5px solid var(--faint); transform: rotate(45deg); transition: transform .15s }
.plan-bar[open] .plan-chevron { transform: rotate(225deg); margin-bottom: -3px }
#plan-bar-title { font-weight: 650; white-space: nowrap }
.plan-bar-current { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim) }
.plan-bar progress { flex: none; width: 64px; height: 4px }
.plan-bar-list { display: grid; gap: 5px; max-height: 34dvh; overflow: auto; margin: 0 0 10px; padding: 0 0 0 2px; list-style: none }
.plan-bar-list li { display: flex; gap: 8px; align-items: baseline; color: var(--dim); overflow-wrap: anywhere }
.plan-bar-list li::before { content: ""; align-self: center; color: var(--faint); -webkit-mask-image: var(--i-circle); mask-image: var(--i-circle) }
.plan-bar-list li[data-status=in_progress] { color: var(--text) }
.plan-bar-list li[data-status=in_progress]::before { color: var(--honey); -webkit-mask-image: var(--i-circle-dot); mask-image: var(--i-circle-dot) }
.plan-bar-list li[data-status=completed] { color: var(--faint); text-decoration: line-through }
.plan-bar-list li[data-status=completed]::before { color: var(--green); -webkit-mask-image: var(--i-circle-check); mask-image: var(--i-circle-check) }
.plan-bar-list .plan-bar-note { color: var(--faint); font-style: italic }
.plan-bar-list .plan-bar-note::before { content: none }

/* Step cards: status badges, first error line, coloured diff */
.status-badge { flex: none; padding: 1px 7px; border: 1px solid var(--rim-2); border-radius: 6px; color: var(--dim); font-size: .66rem; white-space: nowrap }
.status-badge.done { color: var(--green); border-color: #2f4d3e; background: #71d7a40f }
.status-badge.error { color: var(--red); border-color: #5a2f2f; background: #ff8a800f }
.status-badge.running { color: var(--honey); border-color: #5a4a2f; background: #eac1800f }
.step-error { margin: 2px 0 4px 31px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--red); font: .76rem var(--mono) }

/* Attachment strip above the composer */
.draft-files { flex-wrap: nowrap; overflow-x: auto; gap: 8px; padding: 10px 10px 2px; scrollbar-width: none }
.draft-files::-webkit-scrollbar { display: none }
.draft-chip { position: relative; display: flex; align-items: center; gap: 8px; flex: none; max-width: 230px; min-height: 50px; padding: 5px 30px 7px 5px; border: 1px solid var(--rim-2); border-radius: 12px; background: var(--raised); color: var(--text); font-size: .76rem; white-space: normal; overflow: hidden }
.draft-chip.failed { border-color: #5a2f2f }
.draft-thumb, .draft-icon { width: 38px; height: 38px; flex: none; border-radius: 8px; background: var(--panel-2) }
.draft-thumb { object-fit: cover }
.draft-icon { display: grid; place-items: center; font-size: 1rem }
.draft-label { display: grid; min-width: 0 }
.draft-label strong, .draft-label small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.draft-label strong { font-weight: 600 }
.draft-label small { font-size: .68rem }
.draft-remove { position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 22px; min-width: 22px; min-height: 22px; padding: 0; border-radius: 50%; background: var(--panel-2); font-size: .8rem }
.draft-remove:hover:enabled { color: var(--red); border-color: #5a2f2f }
.draft-progress { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 3px }
.draft-chip:not(.pending) .draft-progress { display: none }
.composer.dragging { border-color: var(--green); box-shadow: 0 0 0 3px #71d7a41f }
.attachment.photo-card { width: fit-content; max-width: 100% }
.attachment.photo-card img { width: auto; max-width: min(100%, 420px); max-height: 320px; object-fit: cover; border-radius: 12px; cursor: zoom-in }

/* Quick chips (phones) */
.quick-chips { display: none; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch }
.quick-chips::-webkit-scrollbar { display: none }
.chip { flex: none; min-height: 34px; padding: 0 13px; border-radius: 6px; border-color: var(--rim-2); background: var(--panel); color: var(--dim); font-size: .78rem; white-space: nowrap }
.chip:active { color: var(--text); background: var(--raised) }

/* Files and settings sheets */
.panel-sheet { display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--ink); border-top: 1px solid var(--rim) }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--rim) }
.panel-head strong { font-size: .95rem }
.panel-spacer { flex: 1 }
.files-roots { display: flex; flex: 1; gap: 6px; overflow-x: auto }
.files-path { display: flex; gap: 6px; padding: 10px 14px 6px }
.files-path input { min-width: 0; min-height: 34px; padding: 6px 10px; background: var(--panel); font-size: .8rem }
.files-status { padding: 0 14px 4px; color: var(--honey) }
.files-status:empty { display: none }
.files-list { flex: 1; display: flex; flex-direction: column; gap: 2px; overflow: auto; padding: 4px 10px 16px }
.file-row { display: flex; align-items: center; gap: 10px; min-height: 40px; text-align: left; background: transparent; border-color: transparent }
.file-row:hover:enabled { background: #ffffff08; border-color: transparent }
.file-row-icon { flex: none; width: 22px; text-align: center }
.file-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem }
.files-view { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 0; overflow: hidden; padding: 0 }
.files-bar { flex: none; display: flex; align-items: center; gap: 2px; min-height: 34px; padding: 2px 6px; border-bottom: 1px solid var(--rim); background: #ffffff05 }
.files-bar button { min-height: 28px; padding: 3px 9px; border-color: transparent; background: transparent; font-size: .78rem; white-space: nowrap }
.files-bar button:hover:enabled { background: #ffffff0d; border-color: transparent }
.files-bar .files-bar-icon { width: 28px; padding: 0 }
.files-bar .files-bar-path { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: left; font-family: "Cascadia Code", Consolas, monospace; color: var(--text) }
.files-bar-meta { flex: none; padding: 0 8px; color: var(--faint); font-size: .74rem; white-space: nowrap }
.files-code { flex: 1; min-height: 0; max-height: none; margin: 0; padding: 6px 0; overflow: auto; border: 0; border-radius: 0; font-size: .8rem; line-height: 1.5 }
.files-view > .files-note { flex: none; padding: 4px 10px; font-size: .74rem }
.files-view > .attachment { flex: 1; min-height: 0; display: grid; place-items: center; padding: 6px }
.files-view .attachment img { max-width: 100%; max-height: calc(100dvh - 160px); object-fit: contain }
.files-note { color: var(--faint) }
.settings-list { display: grid; gap: 2px; overflow: auto; padding: 6px 14px 16px }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 4px; border-bottom: 1px solid var(--rim) }
.setting-row > span { display: grid; gap: 3px; min-width: 0 }
.setting-actions { display: flex; flex-wrap: wrap; gap: 8px }
.setting-row small { overflow-wrap: anywhere }

@media (max-width: 920px) {
  .shell, .shell.nav-collapsed { grid-template-columns: var(--rail-w) var(--nav-w) minmax(0, 1fr) }
  .shell.nav-collapsed { grid-template-columns: var(--rail-w) 0 minmax(0, 1fr) }
}
/* Micro-motion, 120–180 ms */
@keyframes hub-appear { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }
@keyframes hub-drawer { from { transform: translateX(-104%) } to { transform: none } }
@keyframes hub-fade { from { opacity: 0 } to { opacity: 1 } }
.feed > * { animation: hub-appear .15s ease-out both }
.task-bar:not([hidden]), .plan-bar:not([hidden]), .panel-sheet:not([hidden]) { animation: hub-appear .15s ease-out both }
.chip, .dock-nav button, .rail-button, .task-stop, .send .icon { transition: transform .12s ease-out, background-color .12s, color .12s, border-color .12s }
.chip:active, .dock-nav button:active, .rail-button:active, .task-stop:active, .send .icon:active { transform: scale(.97) }
.plan-bar > summary::after { transition: transform .15s ease-out }

/* Phones (<= 768px): bottom dock with the same 5 sections, drawer for chats */
@media (max-width: 768px), (max-height: 500px) and (orientation: landscape) and (max-width: 960px) {
  .shell, .shell.nav-collapsed { display: block; padding: 0 }
  .rail { display: none }
  .dock-nav { display: flex; gap: 2px; padding: 3px 6px max(4px, env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--rim) }
  .dock-nav button { flex: 1; display: grid; grid-template-rows: auto auto; gap: 2px; min-width: 0; height: 52px; min-height: 52px; border-radius: 12px; font-size: .64rem }
  .dock-nav button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
  .dock-nav button[aria-current=true] { color: var(--text) }
  .dock-nav button[aria-current=true] svg { color: var(--green) }
  .dock { padding-bottom: 6px }
  .top { flex-wrap: nowrap; padding-inline: 8px }
  .chat-title { flex: 1 1 auto }
  .top-actions { flex: none; justify-content: flex-end }
  .connection { margin-right: 0; font-size: 0 }
  .connection::before { margin-right: 0 }
  .quick-chips { display: flex }
  .sidebar.open { animation: hub-drawer .18s cubic-bezier(.2, .8, .2, 1) both }
  .nav-shade:not([hidden]) { animation: hub-fade .15s ease-out both }
  .feed { padding-bottom: 22px }
  .canvas > .scroll { scroll-padding-bottom: 22px }
  .dock { background: var(--ink) }
  .has-wallpaper .dock { background: color-mix(in srgb, var(--ink) 82%, transparent) }
  .plan-bar { padding: 0 10px }
  .task-bar { padding-inline: 4px 8px }
  .task-stop { min-height: 34px }
  .plan-bar progress { width: 56px }
  .panel-head { padding: 8px 10px }
  .files-path { padding: 8px 10px 4px }
  .files-list, .settings-list { padding-inline: 10px }
  .file-row { min-height: 44px }
  .draft-chip { max-width: 200px }
  .files-bar { flex-wrap: wrap; row-gap: 4px; min-height: 0 }
  .files-bar .files-bar-path { flex: 1 1 100%; order: -1; padding-block: 4px }
  .files-bar button:not(.files-bar-icon):not(.files-bar-path) { min-height: 40px }
  .setting-row { flex-wrap: wrap; row-gap: 8px }
  .setting-row > span { flex: 1 1 100% }
}
@media (max-height: 500px) and (orientation: landscape) {
  .dock-nav button { height: 40px; min-height: 40px }
  .dock-nav button span { display: none }
  .quick-chips { display: none }
}

/* Command palette (Ctrl+K) */
.palette { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-start; justify-content: center; padding: max(12vh, env(safe-area-inset-top)) 12px 12px; background: rgba(0, 0, 0, .55) }
.palette[hidden] { display: none }
.palette-box { width: min(560px, 100%); border: 1px solid var(--rim-2); border-radius: 14px; background: var(--panel); padding: 10px; box-shadow: 0 18px 48px rgba(0, 0, 0, .5); animation: palette-in .15s ease-out }
.palette-input { width: 100%; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--rim-2); background: var(--raised); color: var(--text); font-size: .95rem }
.palette-list { list-style: none; margin: 8px 0 4px; padding: 0; max-height: 52vh; overflow-y: auto }
.palette-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--text) }
.palette-row.active, .palette-row:hover { background: var(--raised) }
.palette-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.palette-kind { flex: none; color: var(--dim); font-size: .75rem }
.palette-empty { padding: 10px; color: var(--dim) }
.palette-hint { color: var(--dim); font-size: .72rem }
@keyframes palette-in { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }
@media (prefers-reduced-motion: reduce) { .palette-box { animation: none } }

/* Live run_command tail inside the active task strip */
.task-live { flex-basis: 100%; margin: 4px 0 0; padding: 5px 8px; max-height: 6.4em; overflow: hidden; border-radius: 6px; background: rgba(0, 0, 0, .35); color: var(--dim); font: .7rem/1.25 ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: pre; text-overflow: ellipsis }
.task-live[hidden], .task-bar[data-collapsed=true] .task-live { display: none }

/* Project profile selector above the chat list */
.project-select { width: 100%; min-height: 32px; margin: 6px 0 2px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--rim-2); background: var(--panel); color: var(--text); font-size: .8rem }

/* Older messages wait behind one quiet button at the top of long chats */
.feed-more { display: block; margin: 4px auto 14px; padding: 4px 14px; border-radius: 6px; font-size: .76rem; color: var(--dim) }

/* Radial quick-copy menu: Left Alt + middle click */
.radial-wheel { position: fixed; z-index: 90; left: 0; top: 0; transform: translate(-50%, -50%); pointer-events: none; user-select: none; border-radius: 50%; background: color-mix(in srgb, var(--panel) 90%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 22px 70px #000000b3, 0 0 0 1px color-mix(in srgb, var(--honey) 12%, transparent), inset 0 0 40px color-mix(in srgb, var(--honey) 6%, transparent); animation: hub-radial .12s ease-out }
.radial-wheel svg { display: block; overflow: visible }
.radial-rim { fill: none; stroke: color-mix(in srgb, var(--honey) 18%, transparent); stroke-width: 1; stroke-dasharray: 2 6 }
.radial-sector { transition: transform .12s ease-out }
.radial-slot { fill: color-mix(in srgb, var(--text) 3%, transparent); stroke: color-mix(in srgb, var(--text) 9%, transparent); stroke-width: 1; transition: fill .12s ease-out, stroke .12s ease-out }
.radial-label { fill: var(--dim); font: 600 10px/1 "JetBrains Mono", ui-monospace, Consolas, monospace; letter-spacing: .09em }
.radial-hint { fill: var(--faint); font: 9px/1 Inter, "Segoe UI", system-ui, sans-serif }
.radial-sector.active .radial-slot { fill: url(#radial-glow); stroke: var(--honey); stroke-width: 1.5; filter: drop-shadow(0 0 5px color-mix(in srgb, var(--honey) 70%, transparent)) drop-shadow(0 0 14px color-mix(in srgb, var(--honey) 40%, transparent)) }
.radial-sector.active .radial-label { fill: var(--text) }
.radial-sector.active .radial-hint { fill: var(--honey) }
.radial-sector.active[data-kind="tunnel"] { transform: translateY(-8px) }
.radial-sector.active[data-kind="bearer"] { transform: translateX(8px) }
.radial-sector.active[data-kind="token"] { transform: translateY(8px) }
.radial-sector.active[data-kind="endpoint"] { transform: translateX(-8px) }
.radial-core-ring { fill: color-mix(in srgb, var(--ink) 94%, transparent); stroke: color-mix(in srgb, var(--honey) 44%, transparent); stroke-width: 1 }
.radial-sector.muted .radial-slot { fill: #ffffff03; stroke: #ffffff0d }
.radial-sector.muted .radial-label, .radial-sector.muted .radial-hint { fill: #6c6c7880 }
.radial-pill { position: absolute; left: 50%; top: -28px; width: 224px; height: 26px; transform: translateX(-50%); box-sizing: border-box; display: flex; align-items: center; gap: 6px; padding: 0 8px; border: 1px solid color-mix(in srgb, var(--text) 9%, transparent); border-radius: 8px; background: color-mix(in srgb, var(--ink) 94%, transparent); color: var(--dim); font: 500 12px/1 Inter, "Segoe UI", system-ui, sans-serif; transition: border-color .1s ease-out }
.radial-pill-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: center; transition: opacity .1s ease-out }
.radial-pill-count { flex: none; color: #9b9ba8; font: 11px/1 "JetBrains Mono", ui-monospace, Consolas, monospace }
.radial-pill-arrow { flex: none; width: 14px; display: grid; place-items: center; color: #9b9ba8 }
.radial-pill-arrow.prev .i { transform: scaleX(-1) }
.radial-pill.single, .radial-pill.empty { justify-content: center }
.radial-pill.empty .radial-pill-name { color: #9b9ba8 }
.radial-pill.switched { animation: hub-radial-flash .1s ease-out }
.radial-pill.switched .radial-pill-name { animation: hub-radial-switch .1s ease-out }
@keyframes hub-radial-flash { from { border-color: var(--honey) } to { border-color: color-mix(in srgb, var(--text) 9%, transparent) } }
@keyframes hub-radial-switch { from { opacity: .55 } to { opacity: 1 } }
.radial-core { position: absolute; left: 50%; top: 50%; width: 104px; transform: translate(-50%, -50%); display: grid; gap: 5px; justify-items: center; text-align: center }
.radial-core strong { color: var(--honey); font: 700 10px/1.2 "JetBrains Mono", ui-monospace, Consolas, monospace; letter-spacing: .1em }
.radial-core small { max-width: 100%; color: #9b9ba8; font: 10px/1.25 "JetBrains Mono", ui-monospace, Consolas, monospace; overflow-wrap: anywhere }
.radial-wheel[data-active=""] .radial-core strong { color: #9b9ba8 }
.radial-toast { position: fixed; z-index: 95; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); max-width: min(380px, calc(100vw - 36px)); padding: 9px 14px; border: 1px solid color-mix(in srgb, var(--honey) 35%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--panel) 92%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: var(--text); font-size: .8rem; box-shadow: 0 12px 32px #00000099; pointer-events: none }
.radial-toast::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--honey); box-shadow: 0 0 8px var(--honey); vertical-align: 1px }
.radial-toast[data-tone="warn"] { border-color: #eac18066; color: #eac180 }
.radial-toast[data-tone="warn"]::before { background: #eac180; box-shadow: none }
.radial-toast.show { animation: hub-toast .15s ease-out }
@keyframes hub-radial { from { opacity: 0; transform: translate(-50%, -50%) scale(.92) } to { opacity: 1; transform: translate(-50%, -50%) scale(1) } }
@keyframes hub-toast { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }

/* «+» menu, groups, the simple Hive header, skill packs and the chat memory window */
.chat-tools { position: relative }
.create-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; display: grid; min-width: 190px; padding: 6px; background: var(--panel); border: 1px solid var(--rim-2); border-radius: 12px; box-shadow: 0 12px 32px #0008 }
.create-menu button { text-align: left; padding: 10px 12px; font-size: 15px; background: transparent; border: 0; border-radius: 8px; color: var(--text) }
.create-menu button:hover, .create-menu button:focus-visible { background: var(--rim-2) }
.hive-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--rim-2) }
.hive-name { font-size: 15px; margin-right: 4px }
.hive-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 }
.hive-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--rim-2); background: transparent; color: var(--text); font-size: 14px; cursor: pointer }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #8a8a94; flex: none }
.dot.online { background: #22c55e }
.dot.working { background: #eab308 }
.dot.offline { background: #8a8a94 }
button.big { padding: 9px 16px; font-size: 15px }
.sheet-dialog { width: min(520px, 94vw) }
.sheet-form { display: grid; gap: 8px; padding: 6px }
.sheet-form h2 { margin: 0 0 4px; font-size: 18px }
.sheet-form input, .sheet-form select, .sheet-form textarea { width: 100%; box-sizing: border-box }
.sheet-label { margin-top: 6px }
.sheet-hint { margin: 0; opacity: .8 }
.sheet-status { min-height: 1em; color: #fca5a5 }
.sheet-actions, .sheet-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end }
.sheet-row input { flex: 1 }
.pick-list { display: grid; gap: 4px; max-height: 40dvh; overflow: auto }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--rim-2); font-size: 15px }
.pick-row input { width: auto }
.hive-task { display: grid; gap: 2px; padding: 8px 10px; border-radius: 8px; border-left: 3px solid #8a8a94; background: #ffffff08 }
.hive-task.doing { border-left-color: #eab308 }
.hive-task.review { border-left-color: #60a5fa }
.hive-task.done { border-left-color: #22c55e; opacity: .75 }
.packs-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 }
.packs-list { display: grid; gap: 6px; margin-bottom: 8px }
.pack-card { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--rim-2); border-radius: 8px }
.pack-card.on { border-color: #22c55e88; background: #22c55e12 }
.pack-info { display: grid; flex: 1; min-width: 0 }
.pack-info small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .75 }
.pack-info .pack-coverage { color: var(--dim); opacity: 1 }
.pack-info .pack-coverage.on { color: var(--green) }
.pack-apply { min-height: 30px; max-width: 168px; padding: 0 8px; border: 1px solid var(--rim-2); border-radius: 8px; background: #0e0e12; color: var(--text); font: inherit; font-size: 12px }
.pack-apply:focus-visible { outline: 2px solid var(--honey); outline-offset: 1px }
#skills-status.error { color: var(--red) }
.pack-form { display: grid; gap: 6px; margin-bottom: 8px; padding: 8px; border: 1px dashed var(--rim-2); border-radius: 8px }
.notes-tabs { display: flex; gap: 6px; flex-wrap: wrap }
.notes-tabs [aria-selected="true"] { border-color: #10b981; color: #fff; background: #10b98122 }
.notes-banner { margin: 0; padding: 8px 10px; border-radius: 8px; background: #eab30818; border: 1px solid #eab30855 }
.note-row { display: flex; align-items: center; gap: 6px }
.note-text { flex: 1; white-space: pre-wrap; word-break: break-word }

/* Stage C composer menus: "+" chat actions and the model picker */
.pop-wrap { position: relative; display: inline-flex }
.pop { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 30; display: grid; gap: 2px; min-width: 248px; max-width: min(320px, calc(100vw - 24px)); max-height: min(60dvh, 440px); overflow: auto; padding: 6px; background: var(--panel); border: 1px solid var(--rim-2); border-radius: 12px; box-shadow: 0 12px 32px #0008 }
.pop.pop-end { left: auto; right: 0 }
.pop[hidden] { display: none }
.compose-tools .pop-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 7px 10px; text-align: left; background: transparent; border: 0; border-radius: 8px; color: var(--text); font-size: .84rem; line-height: 1.25; cursor: pointer }
.compose-tools .pop-item:hover, .compose-tools .pop-item:focus-visible { background: var(--rim-2) }
.compose-tools .pop-item:disabled { color: var(--faint); background: transparent; cursor: default }
.compose-tools .pop-item.danger:not(:disabled) { color: var(--red) }
.pop-icon { flex: none; width: 18px; text-align: center; color: var(--dim) }
.pop-item[aria-checked=true] .pop-icon { color: var(--green) }
.pop-text { display: grid; min-width: 0 }
.pop-text small { color: var(--dim); font-size: .74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.pop-sep { height: 1px; margin: 4px 6px; background: var(--rim-2) }
.pop-empty { padding: 8px 10px; color: var(--dim); font-size: .8rem; line-height: 1.35 }
@media (max-width: 768px) { .compose-tools .pop-item { min-height: 44px } }

/* Chat switch: a compact skeleton while a chat that was not shown yet loads, never bare wallpaper */
.feed-loading { display: grid; align-content: start; gap: 12px; min-height: 40vh; padding: 18px 2px }
.feed-skeleton { display: block; height: 44px; width: 64%; border-radius: 12px; background-color: #16161bcc; background-image: linear-gradient(100deg, #ffffff0a 30%, #ffffff1c 50%, #ffffff0a 70%); background-size: 220% 100%; animation: feed-shimmer 1.3s ease-in-out infinite }
.feed-skeleton.wide { width: 82% }
.feed-skeleton.short { width: 46%; justify-self: end }
.feed-loading-label { color: var(--dim); font-size: .8rem; padding-left: 4px }
@keyframes feed-shimmer { from { background-position: 120% 0 } to { background-position: -120% 0 } }
@media (prefers-reduced-motion: reduce) { .feed-skeleton { animation: none } }

/* ===== notion-code design system (Stage C): typography, spacing, light/dark, keyboard-safe composer ===== */
/* Tokens from notion-code src/ui.html :root: 14px/1.55 sans, mono stack, hairline lines, 4-px spacing scale. */
:root {
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto, Arial, sans-serif;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .17);
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px;
  font-family: var(--sans);
}
html, body { max-width: 100%; overflow-x: hidden }
body { height: var(--vvh, 100dvh); font: 14px/1.55 var(--sans) }
.chat-row { min-height: 34px }
.dock { padding-bottom: var(--space-3) }

/* Light theme: notion-code neutrals on a warm paper background; wallpaper stays hidden. */
:root[data-theme="light"] {
  color-scheme: light;
  --ink: #f7f7f5; --panel: #ffffff; --panel-2: #f3f3f1; --raised: #ececea;
  --rim: #e4e4e0; --rim-2: #d4d4cf;
  --text: #1f1f1d; --dim: #5f5f5a; --faint: #8d8d87;
  --green: #17704a; --green-ink: #e3f4ec; --honey: #85570a; --red: #c4362b;
  --line: rgba(0, 0, 0, .08); --line-2: rgba(0, 0, 0, .16);
}
:root[data-theme="light"] .sidebar, :root[data-theme="light"] .rail { box-shadow: none }
:root[data-theme="light"] .chat-row:hover { background: #0000000a }
:root[data-theme="light"] .chat-row[aria-current=true] { background: #e6f2ec; box-shadow: inset 2px 0 var(--green) }
:root[data-theme="light"] .pop, :root[data-theme="light"] .queue-list, :root[data-theme="light"] .access-options,
:root[data-theme="light"] .skills-popover, :root[data-theme="light"] .jump { box-shadow: 0 12px 32px #0000001f }
:root[data-theme="light"] .feed-skeleton { background-color: #e9e9e6; background-image: linear-gradient(100deg, #0000000a 30%, #00000014 50%, #0000000a 70%) }
:root[data-theme="light"] .radial-toast { background: rgba(255, 255, 255, .95); color: var(--text) }
:root[data-theme="light"] .files-bar { background: #00000005 }

/* High contrast (the desktop «Высокий контраст» palette): text 7:1 and more, borders 3:1 and more
   (WCAG 1.4.11), a 3 px honey focus ring; chosen in Settings or by prefers-contrast: more. */
:root[data-theme="contrast"] {
  color-scheme: dark;
  --ink: #000000; --panel: #000000; --panel-2: #0b0b0b; --raised: #161616;
  --rim: #8c8c8c; --rim-2: #d0d0d0;
  --text: #ffffff; --dim: #dadada; --faint: #b8b8b8;
  --green: #72e8a4; --green-ink: #0e3a1c; --honey: #ffc94d; --red: #ff8a76;
  --line: rgba(255, 255, 255, .55); --line-2: rgba(255, 255, 255, .8);
}
:root[data-theme="contrast"] button, :root[data-theme="contrast"] input, :root[data-theme="contrast"] textarea { background: #000000; border-color: var(--rim) }
:root[data-theme="contrast"] :focus-visible { outline: 3px solid var(--honey); outline-offset: 2px }
:root[data-theme="contrast"] .sidebar, :root[data-theme="contrast"] .rail { box-shadow: none }
:root[data-theme="contrast"] .chat-row:hover { background: #ffffff1f }
:root[data-theme="contrast"] .chat-row[aria-current=true] { background: #0e3a1c; box-shadow: inset 3px 0 var(--green) }

@media (max-width: 768px), (max-height: 500px) and (orientation: landscape) and (max-width: 960px) {
  /* iOS zooms into inputs under 16px; the bottom nav yields its row to the keyboard. */
  textarea, input, select { font-size: 16px }
  .kb-open .dock-nav { display: none }
  button.secondary, .chip { min-height: 44px }
}
/* Chat presence (presence.rs): one fixed 12 px slot, every state its own shape, not only a colour. */
.presence { position: relative; display: inline-block; flex: none; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px }
.presence::before { content: ""; position: absolute; inset: 0; margin: auto; box-sizing: border-box }
.presence.offline::before { width: 7px; height: 1.5px; border-radius: 1px; background: var(--faint) }
.presence.listening::before { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--green) }
.presence.working::before { width: 7px; height: 7px; border-radius: 50%; background: var(--honey); animation: presence-breathe 2.4s ease-in-out infinite }
.presence.awaiting::before { width: 4px; height: 4px; border-radius: 50%; background: #e58f45; box-shadow: 0 0 0 2px var(--panel), 0 0 0 3.2px #e58f45 }
.presence.lost::before { width: 9px; height: 8px; background: var(--red); clip-path: polygon(50% 0, 100% 100%, 0 100%) }
.hive-chip .presence { margin-right: 6px }
.connection[data-online=true][data-agent=lost]::before { background: var(--red); box-shadow: none }
@keyframes presence-breathe { 0%, 100% { opacity: 1 } 50% { opacity: .45 } }
@media (prefers-reduced-motion: reduce) { .presence.working::before { animation: none } }

/* Icons: one Lucide set (assets/icons/lucide, the same shapes as the desktop font) drawn as
   CSS masks in the text colour. Names and data come from the generated block at the end. */
.i { display: inline-block; flex: none; width: 1.15em; height: 1.15em; vertical-align: -.22em; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat }
.i:not(:only-child) { margin-inline-end: .4em }
.mark .i { width: 20px; height: 20px; vertical-align: 0 }
.jump::before, .row.sub::before, .steps-group > summary::after, .plan-bar-list li::before, .upload-retry #upload-name::before {
  content: ""; display: inline-block; flex: none; width: 1em; height: 1em; vertical-align: -.15em; background: currentColor;
  -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat }
.jump::before { margin-inline-end: .35em; -webkit-mask-image: var(--i-arrow-down); mask-image: var(--i-arrow-down) }
.row.sub::before { margin-inline-end: .35em; color: var(--faint); -webkit-mask-image: var(--i-corner-down-right); mask-image: var(--i-corner-down-right) }
.task-toggle .i { transition: transform .15s }
.task-bar[data-collapsed=true] .task-toggle .i { transform: rotate(-90deg) }
.mcp-dot { display: inline-block; width: 8px; height: 8px; margin-inline-end: 6px; border-radius: 50%; vertical-align: .05em; background: var(--faint) }
.mcp-dot[data-state=connected] { background: var(--green) }
.mcp-dot[data-state=starting] { background: var(--honey) }
.mcp-dot[data-state=error] { background: var(--red) }
.clients-badge { margin-inline-start: 6px; padding: 0 6px; border-radius: 8px; font-size: .75em; color: var(--honey); border: 1px solid currentColor; white-space: nowrap }
.connection-row small { display: block }
@media (prefers-reduced-motion: reduce) { .task-toggle .i { transition: none } }

/* ===== Wave 3: studio graphite components ===== */
.code-count, .plan-count, .diff-num, .diff-stat, .step-time, .worker-beat, .palette-status, .plan-attempts, .stat small, #promtik-workers-count { font-variant-numeric: tabular-nums }
.eyebrow { color: var(--faint); font-size: .66rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase }
.role-badge { flex: none; padding: 0 6px; border: 1px solid var(--rim-2); border-radius: 5px; color: var(--dim); font: 600 .64rem/16px var(--mono); white-space: nowrap }
.state-pill { padding: 1px 8px; border: 1px solid var(--rim-2); border-radius: 999px; color: var(--dim); font-size: .72rem }
.state-pill[data-state=running] { color: var(--honey); border-color: #5a4a2f }
.state-pill[data-state=paused] { color: var(--red); border-color: #5a2f2f }

/* Tool-call rows: name · time · status · one line of result */
.step-result { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--faint); font: .74rem var(--mono) }
.step > summary { min-height: 30px }
.ticket-preview { display: inline-block; margin: 4px 6px 4px 31px; padding: 0; border: 1px solid var(--rim); border-radius: 8px; background: var(--raised); overflow: hidden; cursor: zoom-in }
.ticket-preview img { display: block; max-width: min(320px, 100%); max-height: 200px; object-fit: cover }

/* Right panel: «Живой код / Diff» */
.code-panel { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: var(--panel); border: 1px solid var(--rim); border-radius: 12px }
.code-resize { position: absolute; z-index: 2; top: 0; bottom: 0; left: -5px; width: 9px; cursor: col-resize; touch-action: none }
.code-resize:hover, .code-resize:focus-visible { outline: none; background: linear-gradient(90deg, transparent 4px, var(--rim-2) 4px, var(--rim-2) 5px, transparent 5px) }
.code-head { display: flex; align-items: center; gap: 8px; padding: 9px 10px 9px 14px; border-bottom: 1px solid var(--rim); font-size: .86rem }
.code-count { color: var(--dim); font: .74rem var(--mono) }
.code-source { padding: 0 6px; border: 1px solid var(--rim-2); border-radius: 5px; color: var(--faint); font: .64rem/16px var(--mono) }
.code-source[data-source=live] { color: var(--green); border-color: #2f4d3e }
.code-files { flex: none; max-height: 34%; overflow: auto; padding: 4px; border-bottom: 1px solid var(--rim) }
.code-file { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 8px; width: 100%; min-height: 40px; padding: 5px 8px; border: 1px solid transparent; border-radius: 7px; background: none; color: var(--text); text-align: left }
.code-file:hover { background: #ffffff08 }
.code-file[aria-pressed=true] { background: var(--raised); border-color: var(--rim-2) }
.code-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem }
.code-file-path { grid-row: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--faint); font: .68rem var(--mono); direction: rtl; text-align: left }
.code-file .diff-stat { grid-row: 1 / 3; grid-column: 2; align-self: center }
.diff-stat { color: var(--dim); font: .7rem var(--mono); white-space: nowrap }
.code-diff { flex: 1; min-height: 0; overflow: auto }
.code-diff .empty, .code-files .empty { padding: 14px; color: var(--faint); font-size: .8rem }
.diff-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--panel); border-bottom: 1px solid var(--rim) }
.diff-path { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .74rem; color: var(--dim) }
.diff-table { min-width: max-content; padding: 4px 0 12px; font: .74rem/1.55 var(--mono) }
.diff-line { display: grid; grid-template-columns: 4.5ch 4.5ch 2ch auto }
.diff-line.hunk, .diff-line.meta { display: block; padding: 2px 10px; color: #8fa4c7; background: #8fa4c70d }
.diff-line.meta { color: var(--faint); background: none }
.diff-num { padding-right: 6px; color: var(--faint); text-align: right; user-select: none; border-right: 1px solid var(--rim) }
.diff-sign { text-align: center; user-select: none; color: var(--faint) }
.diff-text { padding-right: 14px; white-space: pre }
.diff-line.add { background: #71d7a412 }
.diff-line.add .diff-sign, .diff-line.add .diff-text { color: var(--green) }
.diff-line.del { background: #ff8a8012 }
.diff-line.del .diff-sign, .diff-line.del .diff-text { color: var(--red) }
.code-frames { flex: none; max-height: 40%; overflow: auto; border-top: 1px solid var(--rim) }
.code-frames > summary { padding: 7px 14px; color: var(--dim); font-size: .76rem; cursor: pointer }
.code-frames #previews { padding: 0 10px 10px }
.code-frames img { max-width: 100%; border-radius: 6px; border: 1px solid var(--rim) }
.diff-toggle[aria-expanded=true] { color: var(--text); border-color: var(--rim-2) }

/* Mission Control: ПЛАН + Промтик */
.mission-body { flex: 1; min-height: 0; overflow: auto; display: grid; align-content: start; gap: 14px; padding: 14px }
.mission-title { margin: 4px 0 0; color: var(--dim); font-size: .8rem; font-weight: 600 }
.mission-status { min-height: 1em; color: var(--dim); font-size: .76rem }
.mission-actions, .plan-goal-actions { display: flex; flex-wrap: wrap; gap: 8px }
.plan-select { max-width: 260px; min-height: 32px }
.plan-goal { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--rim); border-radius: 10px; background: var(--panel) }
.plan-goal-text { margin: 0; font-size: .95rem; line-height: 1.45 }
.plan-project { color: var(--faint); font: .7rem var(--mono); overflow-wrap: anywhere }
.plan-board { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 4px }
.plan-column { display: grid; align-content: start; gap: 6px; min-width: 0; padding: 8px; border: 1px solid var(--rim); border-radius: 10px; background: var(--panel) }
.plan-column-head { display: flex; align-items: center; gap: 6px; padding: 2px 2px 6px; border-bottom: 1px solid var(--rim); font-size: .78rem }
.plan-key { color: var(--faint); font: .64rem var(--mono) }
.plan-column-head .plan-count { margin-left: auto; color: var(--dim); font: .72rem var(--mono) }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint) }
.plan-column[data-status=in_progress] .status-dot { background: var(--honey) }
.plan-column[data-status=review] .status-dot { background: #8fa4c7 }
.plan-column[data-status=blocked] .status-dot { background: var(--red) }
.plan-column[data-status=done] .status-dot { background: var(--green) }
.plan-empty { margin: 0; padding: 6px; color: var(--faint); font-size: .76rem }
.plan-card { display: grid; gap: 6px; padding: 8px 9px; border: 1px solid var(--rim); border-radius: 8px; background: var(--raised) }
.plan-card-title { font-size: .82rem; font-weight: 600; overflow-wrap: anywhere }
.plan-card-text { margin: 0; color: var(--dim); font-size: .74rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden }
.plan-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .72rem }
.plan-chat { display: inline-flex; align-items: center; gap: 4px; min-height: 26px; padding: 0 6px; border: 1px solid var(--rim-2); border-radius: 6px; background: none; color: var(--text); font-size: .72rem }
.plan-chat .presence { margin-right: 0 }
.plan-unassigned, .plan-attempts { color: var(--faint) }
.plan-locks { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; color: var(--dim); font: .66rem var(--mono) }
.plan-locks li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.plan-card-actions { display: flex; align-items: center; gap: 6px }
.plan-move { flex: 1; min-width: 0; min-height: 30px; font-size: .72rem }
.plan-task-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px }
.stat { display: grid; gap: 4px; min-width: 0; padding: 12px 14px; border: 1px solid var(--rim); border-radius: 10px; background: var(--panel) }
.stat strong { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.stat small { color: var(--faint); font-size: .72rem; overflow-wrap: anywhere }
#promtik-tunnel[data-state=online] { color: var(--green) }
#promtik-tunnel[data-state=failed] { color: var(--red) }
.worker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px }
.worker-card { display: grid; gap: 4px; min-height: 60px; padding: 10px 12px; border: 1px solid var(--rim); border-radius: 10px; background: var(--panel); color: var(--text); text-align: left }
.worker-card:hover { border-color: var(--rim-2) }
.worker-card[aria-current=true] { border-color: #2f4d3e }
.worker-head { display: flex; align-items: center; gap: 6px; min-width: 0 }
.worker-head strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem }
.worker-beat { color: var(--faint); font: .7rem var(--mono) }
.worker-grid .empty { color: var(--faint); font-size: .8rem }

/* Quick menu rows: presence · title · role · heartbeat · kind */
.palette-row { align-items: center; min-height: 40px }
.palette-row .presence { margin-right: 0 }
.palette-title { flex: 1; min-width: 0 }
.palette-status { flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--faint); font: .7rem var(--mono) }

/* Tablet: the code panel becomes an overlay sheet only when asked for */
@media (max-width: 1100px) {
  .shell, .shell.code-collapsed { grid-template-columns: var(--rail-w) var(--nav-w) minmax(0, 1fr) 0 }
  .shell.nav-collapsed, .shell.nav-collapsed.code-collapsed { grid-template-columns: var(--rail-w) 0 minmax(0, 1fr) 0 }
  .code-panel { visibility: hidden; border-width: 0 }
  .code-resize { display: none }
  .shell.code-sheet .code-panel { visibility: visible; position: fixed; z-index: 8; top: 8px; right: 8px; bottom: 8px; width: min(560px, calc(100vw - 16px)); border-width: 1px }
  .plan-board { grid-template-columns: repeat(5, minmax(190px, 78vw)) }
}
/* Phones: bottom tab bar already set; the Diff tab is a full-screen sheet above it */
@media (max-width: 768px), (max-height: 500px) and (orientation: landscape) and (max-width: 960px) {
  .code-panel { display: none }
  .shell.code-sheet .code-panel { display: flex; position: fixed; z-index: 8; visibility: visible; inset: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) calc(58px + env(safe-area-inset-bottom, 0px)) env(safe-area-inset-left, 0px); width: auto; border-radius: 0; border-width: 0 0 1px }
  .canvas { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px) }
  .dock-nav { position: relative; z-index: 9; padding-left: max(6px, env(safe-area-inset-left)); padding-right: max(6px, env(safe-area-inset-right)) }
  .dock-nav button { min-height: 52px; min-width: 52px }
  .code-file { min-height: 48px }
  .mission-body { padding: 10px }
  .plan-task-form { grid-template-columns: 1fr }
  .plan-task-form > * { min-height: 44px }
  .mission-actions button, .plan-goal-actions button, .plan-move, .plan-chat, .worker-card { min-height: 44px }
  .palette-row { min-height: 48px }
  .palette-status { display: none }
}
:root[data-theme="light"] .code-panel, :root[data-theme="light"] .plan-column, :root[data-theme="light"] .stat, :root[data-theme="light"] .worker-card { background: var(--panel) }
/* icons:start (generated by src/web/icons.cjs from assets/icons, do not edit) */
:root {
  --i-arrow-down: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='M12 5v14' /%3E%3Cpath d='m19 12-7 7-7-7' /%3E%3C/svg%3E");
  --i-arrow-left: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='m12 19-7-7 7-7' /%3E%3Cpath d='M19 12H5' /%3E%3C/svg%3E");
  --i-arrow-up: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='m5 12 7-7 7 7' /%3E%3Cpath d='M12 19V5' /%3E%3C/svg%3E");
  --i-brain: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='M12 18V5' /%3E%3Cpath d='M15 13a4.17 4.17 0 01-3-4 4.17 4.17 0 01-3 4' /%3E%3Cpath d='M17.707 6.294A3 3 0 1012 5a3 3 0 10-5.707 1.294' /%3E%3Cpath d='M17.996 5.125a4 4 0 012.526 5.77' /%3E%3Cpath d='M18 18a4 4 0 002-7.465' /%3E%3Cpath d='M19.967 17.482a4 4 0 11-7.967.517 4 4 0 11-7.967-.517' /%3E%3Cpath d='M6 18a4 4 0 01-2-7.465' /%3E%3Cpath d='M6.004 5.125a4 4 0 00-2.526 5.77' /%3E%3C/svg%3E");
  --i-brush-cleaning: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='m16 22-1-4' /%3E%3Cpath d='M19 14a1 1 0 0 0 1-1v-1a2 2 0 0 0-2-2h-3a1 1 0 0 1-1-1V4a2 2 0 0 0-4 0v5a1 1 0 0 1-1 1H6a2 2 0 0 0-2 2v1a1 1 0 0 0 1 1' /%3E%3Cpath d='M19 14H5l-1.973 6.767A1 1 0 0 0 4 22h16a1 1 0 0 0 .973-1.233z' /%3E%3Cpath d='m8 22 1-4' /%3E%3C/svg%3E");
  --i-check: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='M20 6 9 17l-5-5' /%3E%3C/svg%3E");
  --i-chevron-down: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='m6 9 6 6 6-6' /%3E%3C/svg%3E");
  --i-chevron-right: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='m9 18 6-6-6-6' /%3E%3C/svg%3E");
  --i-circle: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Ccircle cx='12' cy='12' r='10' /%3E%3C/svg%3E");
  --i-circle-alert: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Ccircle cx='12' cy='12' r='10' /%3E%3Cline x1='12' x2='12' y1='8' y2='12' /%3E%3Cline x1='12' x2='12.01' y1='16' y2='16' /%3E%3C/svg%3E");
  --i-circle-check: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Ccircle cx='12' cy='12' r='10' /%3E%3Cpath d='m16 9-5.5 5.5L8 12' /%3E%3C/svg%3E");
  --i-circle-dot: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Ccircle cx='12' cy='12' r='1' /%3E%3Ccircle cx='12' cy='12' r='10' /%3E%3C/svg%3E");
  --i-clipboard-paste: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='M11 14h10' /%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v1.344' /%3E%3Cpath d='m17 18 4-4-4-4' /%3E%3Cpath d='M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113' /%3E%3Crect x='8' y='2' width='8' height='4' rx='1' /%3E%3C/svg%3E");
  --i-command: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3' /%3E%3C/svg%3E");
  --i-copy: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Crect width='14' height='14' x='8' y='8' rx='2' ry='2' /%3E%3Cpath d='M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2' /%3E%3C/svg%3E");
  --i-corner-down-right: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='m15 10 5 5-5 5' /%3E%3Cpath d='M4 4v7a4 4 0 0 0 4 4h12' /%3E%3C/svg%3E");
  --i-corner-left-up: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='M14 9 9 4 4 9' /%3E%3Cpath d='M20 20h-7a4 4 0 0 1-4-4V4' /%3E%3C/svg%3E");
  --i-cpu: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='M12 20v2' /%3E%3Cpath d='M12 2v2' /%3E%3Cpath d='M17 20v2' /%3E%3Cpath d='M17 2v2' /%3E%3Cpath d='M2 12h2' /%3E%3Cpath d='M2 17h2' /%3E%3Cpath d='M2 7h2' /%3E%3Cpath d='M20 12h2' /%3E%3Cpath d='M20 17h2' /%3E%3Cpath d='M20 7h2' /%3E%3Cpath d='M7 20v2' /%3E%3Cpath d='M7 2v2' /%3E%3Crect x='4' y='4' width='16' height='16' rx='2' /%3E%3Crect x='8' y='8' width='8' height='8' rx='1' /%3E%3C/svg%3E");
  --i-download: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='M12 15V3' /%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4' /%3E%3Cpath d='m7 10 5 5 5-5' /%3E%3C/svg%3E");
  --i-file: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z' /%3E%3Cpath d='M14 2v5a1 1 0 0 0 1 1h5' /%3E%3C/svg%3E");
  --i-file-text: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z' /%3E%3Cpath d='M14 2v5a1 1 0 0 0 1 1h5' /%3E%3Cpath d='M10 9H8' /%3E%3Cpath d='M16 13H8' /%3E%3Cpath d='M16 17H8' /%3E%3C/svg%3E");
  --i-folder: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z' /%3E%3C/svg%3E");
  --i-hexagon: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z' /%3E%3C/svg%3E");
  --i-hub-mark: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cmask id='hub-cut'%3E%3Cpath d='M22.5 12 17.25 2.9H6.75L1.5 12l5.25 9.1h10.5Z' fill='white'/%3E%3Cpath d='M12 12h6.4M12 12 8.8 17.54M12 12 8.8 6.46' stroke='black' stroke-width='2.25' stroke-linecap='round'/%3E%3Ccircle cx='12' cy='12' r='3' fill='black'/%3E%3C/mask%3E%3Cpath d='M22.5 12 17.25 2.9H6.75L1.5 12l5.25 9.1h10.5Z' fill='white' mask='url(%23hub-cut)'/%3E%3C/svg%3E");
  --i-image: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Crect width='18' height='18' x='3' y='3' rx='2' ry='2' /%3E%3Ccircle cx='9' cy='9' r='2' /%3E%3Cpath d='m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21' /%3E%3C/svg%3E");
  --i-info: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Ccircle cx='12' cy='12' r='10' /%3E%3Cpath d='M12 16v-4' /%3E%3Cpath d='M12 8h.01' /%3E%3C/svg%3E");
  --i-menu: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='M4 5h16' /%3E%3Cpath d='M4 12h16' /%3E%3Cpath d='M4 19h16' /%3E%3C/svg%3E");
  --i-panel-left: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Crect width='18' height='18' x='3' y='3' rx='2' /%3E%3Cpath d='M9 3v18' /%3E%3C/svg%3E");
  --i-paperclip: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551' /%3E%3C/svg%3E");
  --i-pencil: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z' /%3E%3Cpath d='m15 5 4 4' /%3E%3C/svg%3E");
  --i-play: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z' /%3E%3C/svg%3E");
  --i-plug: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='M12 22v-5' /%3E%3Cpath d='M15 8V2' /%3E%3Cpath d='M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z' /%3E%3Cpath d='M9 8V2' /%3E%3C/svg%3E");
  --i-search: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='m21 21-4.34-4.34' /%3E%3Ccircle cx='11' cy='11' r='8' /%3E%3C/svg%3E");
  --i-shrink: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='m15 15 6 6m-6-6v4.8m0-4.8h4.8' /%3E%3Cpath d='M9 19.8V15m0 0H4.2M9 15l-6 6' /%3E%3Cpath d='M15 4.2V9m0 0h4.8M15 9l6-6' /%3E%3Cpath d='M9 4.2V9m0 0H4.2M9 9 3 3' /%3E%3C/svg%3E");
  --i-square: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Crect width='18' height='18' x='3' y='3' rx='2' /%3E%3C/svg%3E");
  --i-star: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z' /%3E%3C/svg%3E");
  --i-undo-2: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='M9 14 4 9l5-5' /%3E%3Cpath d='M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11' /%3E%3C/svg%3E");
  --i-upload: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='M12 3v12' /%3E%3Cpath d='m17 8-5-5-5 5' /%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4' /%3E%3C/svg%3E");
  --i-wrench: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z' /%3E%3C/svg%3E");
  --i-x: url("data:image/svg+xml,%3Csvg shape-rendering='geometricPrecision' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='M18 6 6 18' /%3E%3Cpath d='m6 6 12 12' /%3E%3C/svg%3E");
}
.i-arrow-down { --i: var(--i-arrow-down) }
.i-arrow-left { --i: var(--i-arrow-left) }
.i-arrow-up { --i: var(--i-arrow-up) }
.i-brain { --i: var(--i-brain) }
.i-brush-cleaning { --i: var(--i-brush-cleaning) }
.i-check { --i: var(--i-check) }
.i-chevron-down { --i: var(--i-chevron-down) }
.i-chevron-right { --i: var(--i-chevron-right) }
.i-circle { --i: var(--i-circle) }
.i-circle-alert { --i: var(--i-circle-alert) }
.i-circle-check { --i: var(--i-circle-check) }
.i-circle-dot { --i: var(--i-circle-dot) }
.i-clipboard-paste { --i: var(--i-clipboard-paste) }
.i-command { --i: var(--i-command) }
.i-copy { --i: var(--i-copy) }
.i-corner-down-right { --i: var(--i-corner-down-right) }
.i-corner-left-up { --i: var(--i-corner-left-up) }
.i-cpu { --i: var(--i-cpu) }
.i-download { --i: var(--i-download) }
.i-file { --i: var(--i-file) }
.i-file-text { --i: var(--i-file-text) }
.i-folder { --i: var(--i-folder) }
.i-hexagon { --i: var(--i-hexagon) }
.i-hub-mark { --i: var(--i-hub-mark) }
.i-image { --i: var(--i-image) }
.i-info { --i: var(--i-info) }
.i-menu { --i: var(--i-menu) }
.i-panel-left { --i: var(--i-panel-left) }
.i-paperclip { --i: var(--i-paperclip) }
.i-pencil { --i: var(--i-pencil) }
.i-play { --i: var(--i-play) }
.i-plug { --i: var(--i-plug) }
.i-search { --i: var(--i-search) }
.i-shrink { --i: var(--i-shrink) }
.i-square { --i: var(--i-square) }
.i-star { --i: var(--i-star) }
.i-undo-2 { --i: var(--i-undo-2) }
.i-upload { --i: var(--i-upload) }
.i-wrench { --i: var(--i-wrench) }
.i-x { --i: var(--i-x) }
/* icons:end */

/* Desktop parity: the default "obsidian" theme uses the warm honey palette of src/ui/theme.rs
   (BG_CANVAS, BG_SURFACE, HAIRLINE, BORDER, TEXT, MUTED, ACCENT, SUCCESS, DANGER). */
:root:not([data-theme]), :root[data-theme="obsidian"] {
  --ink: #111010;
  --panel: #191817;
  --panel-2: #1d1c1a;
  --raised: #211f1d;
  --rim: #262421;
  --rim-2: #34312d;
  --text: #ede9e3;
  --dim: #9c958b;
  --faint: #6f695f;
  --honey: #e9a93b;
  --green: #7db88a;
  --red: #e0705a;
  --line: rgba(237, 233, 227, .08);
  --line-2: rgba(237, 233, 227, .16);
}
:root:not([data-theme]) .chat-row[aria-current=true], :root[data-theme="obsidian"] .chat-row[aria-current=true] {
  background: rgba(233, 169, 59, .10); box-shadow: inset 2px 0 var(--honey)
}
:root:not([data-theme]) .rail-button[aria-current=true]::before, :root[data-theme="obsidian"] .rail-button[aria-current=true]::before { background: var(--honey) }
:root:not([data-theme]) .dock-nav button[aria-current=true] svg, :root[data-theme="obsidian"] .dock-nav button[aria-current=true] svg { color: var(--honey) }
:root:not([data-theme]) .worker-card[aria-current=true], :root[data-theme="obsidian"] .worker-card[aria-current=true] { border-color: rgba(233, 169, 59, .45) }

/* ===== Motion: spring popovers, stagger, honey wave, copy pulse, theme fade ===== */
:root { --ease-spring: cubic-bezier(.34, 1.56, .64, 1); --ease-out: cubic-bezier(.2, .8, .2, 1); --dur-fast: 140ms; --dur: 200ms }
@keyframes hub-pop { from { opacity: 0; scale: .94; translate: 0 4px } to { opacity: 1; scale: 1; translate: 0 0 } }
.skills-popover:not([hidden]), .queue-list, .access-menu[open] > .access-options, .pop, .jump { animation: hub-pop var(--dur) var(--ease-spring) both }
.skills-popover:not([hidden]) { transform-origin: 50% 100% }
.access-menu[open] > .access-options, .queue-list, .pop, .jump { transform-origin: 50% 0 }

@keyframes hub-row-in { from { opacity: 0; translate: -6px 0 } to { opacity: 1; translate: 0 0 } }
.sidebar.open .chat-row { animation: hub-row-in var(--dur) var(--ease-out) both; animation-delay: 216ms }
.sidebar.open .chat-row:nth-child(1) { animation-delay: 0ms }
.sidebar.open .chat-row:nth-child(2) { animation-delay: 18ms }
.sidebar.open .chat-row:nth-child(3) { animation-delay: 36ms }
.sidebar.open .chat-row:nth-child(4) { animation-delay: 54ms }
.sidebar.open .chat-row:nth-child(5) { animation-delay: 72ms }
.sidebar.open .chat-row:nth-child(6) { animation-delay: 90ms }
.sidebar.open .chat-row:nth-child(7) { animation-delay: 108ms }
.sidebar.open .chat-row:nth-child(8) { animation-delay: 126ms }
.sidebar.open .chat-row:nth-child(9) { animation-delay: 144ms }
.sidebar.open .chat-row:nth-child(10) { animation-delay: 162ms }
.sidebar.open .chat-row:nth-child(11) { animation-delay: 180ms }
.sidebar.open .chat-row:nth-child(12) { animation-delay: 198ms }

@keyframes hub-step-in { from { opacity: 0; translate: 0 6px } to { opacity: 1; translate: 0 0 } }
.steps-group[open] > :not(summary) { animation: hub-step-in var(--dur) var(--ease-out) both; animation-delay: 160ms }
.steps-group[open] > :not(summary):nth-child(2) { animation-delay: 0ms }
.steps-group[open] > :not(summary):nth-child(3) { animation-delay: 16ms }
.steps-group[open] > :not(summary):nth-child(4) { animation-delay: 32ms }
.steps-group[open] > :not(summary):nth-child(5) { animation-delay: 48ms }
.steps-group[open] > :not(summary):nth-child(6) { animation-delay: 64ms }
.steps-group[open] > :not(summary):nth-child(7) { animation-delay: 80ms }
.steps-group[open] > :not(summary):nth-child(8) { animation-delay: 96ms }
.steps-group[open] > :not(summary):nth-child(9) { animation-delay: 112ms }
.steps-group[open] > :not(summary):nth-child(10) { animation-delay: 128ms }
.steps-group[open] > :not(summary):nth-child(11) { animation-delay: 144ms }
.steps-group > summary::after { transition: transform var(--dur) var(--ease-spring) }

/* Honey wave: the working dot breathes and sends two rings outward */
@keyframes hub-breathe { 0%, 100% { scale: .85 } 50% { scale: 1 } }
@keyframes hub-wave { from { scale: 1; opacity: .6 } to { scale: 2.6; opacity: 0 } }
.task-spinner { position: relative; animation: hub-breathe 1.6s ease-in-out infinite }
/* V2: no outward rings — the dot only breathes */
.task-spinner::before, .task-spinner::after { content: none }

/* Copy confirmation: JS sets .copied on the button for 900 ms */
@keyframes hub-copied { 0% { scale: 1 } 30% { scale: .92 } 65% { scale: 1.04 } 100% { scale: 1 } }
.code-header button, button.copy-message, #connection, #hub-copy-mcp { transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), outline-color var(--dur-fast) var(--ease-out) }
.copied { animation: hub-copied 360ms var(--ease-spring) both; color: var(--honey); border-color: var(--honey); outline-color: var(--honey) }

/* Theme change: JS sets .theme-switching on :root for 280 ms */
:root.theme-switching, :root.theme-switching *, :root.theme-switching *::before, :root.theme-switching *::after { transition: background-color 240ms ease, color 240ms ease, border-color 240ms ease, fill 240ms ease, stroke 240ms ease !important }

@media (prefers-reduced-motion: reduce) {
  .skills-popover:not([hidden]), .queue-list, .access-menu[open] > .access-options, .pop, .jump, .sidebar.open .chat-row, .steps-group[open] > :not(summary), .task-spinner, .copied { animation: none !important }
  .task-spinner::before, .task-spinner::after { display: none }
  .steps-group > summary::after { transition: none !important }
  :root.theme-switching, :root.theme-switching *, :root.theme-switching *::before, :root.theme-switching *::after { transition: none !important }
}

/* Compact phone layout (step 315) */
@media (max-width: 768px), (max-height: 500px) and (orientation: landscape) and (max-width: 960px) {
  header.top { min-height: 48px; gap: 4px; flex-wrap: nowrap; align-items: center }
  .top .chat-title { flex: 1 1 auto; min-width: 0; overflow: hidden }
  .top .chat-title h1 { font-size: 1rem; line-height: 1.2; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
  .top .chat-title small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
  .top .top-actions { flex: none; flex-wrap: nowrap; gap: 4px; align-items: center }
  .top #nav-toggle.icon, .top .top-actions button.icon { width: 36px; height: 36px; min-width: 36px; min-height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; flex: none }
  .top #nav-toggle.icon .i, .top .top-actions button.icon .i { width: 18px; height: 18px }
  .top .top-actions #palette-open, .top .top-actions #diff-toggle { display: none }
  .top .top-actions #afk.secondary, .top .top-actions #chat-memory.secondary { font-size: .72rem; padding: 0 8px; height: 32px; min-height: 32px; min-width: 0; white-space: nowrap; flex: none }
  .composer .compose-tools { display: flex; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; gap: 4px; align-items: center; scrollbar-width: none }
  .composer .compose-tools::-webkit-scrollbar { display: none }
  .composer .compose-tools > * { flex: none }
  .composer .compose-tools button { height: 34px; min-height: 34px; white-space: nowrap; flex: none }
  .composer .compose-tools button.icon, .composer .compose-tools #mcp-toggle, .composer .compose-tools #memory-toggle, .composer .compose-tools #modelBtn { width: 34px; min-width: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center }
  .composer .compose-tools .skills-toggle .i { margin: 0 }
  .composer .compose-tools .skills-toggle .i + span { display: none }
  .composer .compose-tools #skills-toggle, .composer .compose-tools #connections-toggle { font-size: .74rem; padding: 0 8px; min-width: 0 }
  .composer .compose-tools .pop { position: fixed; left: 6px; right: 6px; top: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 120px); width: auto; min-width: 0; max-width: none; max-height: 60dvh; overflow: auto; transform: none }
  .composer textarea { min-height: 44px; padding: 8px 10px 2px; font-size: 16px }
  .composer .compose-footer { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; padding: 4px 6px }
  .composer .compose-footer .workspace-name { min-width: 0; flex: 0 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
  .composer .compose-footer .auto-loop { font-size: 0; flex: none }
  .composer .compose-footer .auto-loop input { margin: 0 }
  .composer .access-menu summary { display: block; height: 32px; min-height: 32px; line-height: 32px; font-size: .72rem; max-width: 110px; padding: 0 8px; box-sizing: border-box; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
  .composer .send { gap: 6px; flex: none; align-items: center }
  .composer .send .pill { height: 34px; min-height: 34px; font-size: .74rem; padding: 0 10px; white-space: nowrap }
  .composer .send #send-now { width: 38px; min-width: 38px; height: 38px; min-height: 38px; padding: 0; border-radius: 50% }
  .feed { padding: 8px 8px 12px }
  .feed .bubble, .feed .bubble:not(.operator) { font-size: .92rem; padding: 8px 10px }
  .feed .bubble.operator { max-width: 90% }
  button.secondary, .chip { min-height: 34px }
}
@media (max-width: 400px) {
  header.top { flex-wrap: nowrap }
  .top .top-actions { flex: none; width: auto; max-width: none }
  .top .chat-title small#agent { display: none }
  .top .top-actions #chat-memory { display: none }
}

/* Empty-state cockpit (step 321) */
.empty.cockpit { gap: 12px; width: min(520px, 100%); padding: 34px 12px }
.cockpit-logo { position: relative; width: 76px; height: 76px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--honey) 28%, transparent) 0%, color-mix(in srgb, var(--honey) 10%, transparent) 42%, transparent 70%); animation: cockpit-logo-in 400ms cubic-bezier(.2, .8, .2, 1) both }
.cockpit-logo::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--honey) 22%, transparent); background: var(--panel); box-shadow: 0 0 24px color-mix(in srgb, var(--honey) 18%, transparent), inset 0 1px 0 #ffffff0a }
.cockpit-logo .i { position: relative; z-index: 1; width: 30px; height: 30px; color: var(--honey) }
.empty.cockpit h2 { margin: 4px 0 0; color: var(--text) }
.cockpit-subtitle { margin-top: -6px; font-size: .78rem; color: var(--faint) }
.cockpit-telemetry { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 4px }
.cockpit-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--rim); border-radius: 999px; background: var(--panel); font-size: .75rem; line-height: 1.4 }
.cockpit-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); flex: none; transition: background-color 220ms ease }
.cockpit-chip-label { color: var(--faint) }
.cockpit-chip-value { color: var(--text) }
.cockpit-chip:is([data-state=online], [data-state=listening]) .cockpit-dot { background: var(--green) }
.cockpit-chip:is([data-state=working], [data-state=awaiting], [data-state=connecting], [data-state=reconnecting]) .cockpit-dot { background: var(--honey) }
.cockpit-chip:is([data-state=failed], [data-state=lost]) .cockpit-dot { background: var(--red) }
.cockpit-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; margin-top: 8px }
.cockpit-card { display: flex; align-items: center; gap: 10px; padding: 11px 12px; text-align: left; border: 1px solid var(--rim); border-radius: 12px; background: var(--panel); color: var(--text); cursor: pointer; font: inherit; box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 6%, transparent); transition: border-color 160ms ease, transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease; animation: cockpit-card-in 320ms cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 40ms + 120ms) }
.cockpit-card:hover { border-color: color-mix(in srgb, var(--honey) 45%, var(--rim)); background: var(--panel-2); transform: translateY(-2px); box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 8%, transparent), 0 6px 18px #00000047 }
.cockpit-card:focus-visible { outline: 2px solid var(--honey); outline-offset: 2px }
.cockpit-card-icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--rim-2); background: var(--raised); color: var(--honey) }
.cockpit-card-icon .i { width: 16px; height: 16px; margin: 0 }
.cockpit-card-text { display: grid; gap: 2px; min-width: 0 }
.cockpit-card-title { font-size: .82rem; font-weight: 600 }
.cockpit-card-hint { font-size: .72rem; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.cockpit-actions { width: auto; margin-top: 2px }
.empty .cockpit-link { min-height: 0; background: none; border: 0; box-shadow: none; color: var(--dim); font-size: .78rem; padding: 4px 6px; text-decoration: underline; text-decoration-color: var(--rim-2); text-underline-offset: 3px }
.empty .cockpit-link:hover { color: var(--honey); text-decoration-color: var(--honey); background: none }
@keyframes cockpit-logo-in { from { opacity: 0; transform: scale(.86) } to { opacity: 1; transform: none } }
@keyframes cockpit-card-in { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }
@media (max-width: 420px) { .cockpit-cards { grid-template-columns: 1fr } }

/* Depth, texture and motion (step 321) */
.canvas > .scroll { background-image: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--text) 5%, transparent) 1px, transparent 1.5px); background-size: 22px 22px; background-attachment: local }
.bubble:not(.operator), .bubble.operator, .pop, .skills-popover, form.composer { box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 7%, transparent), 0 8px 24px -12px #0009 }
@media (min-width: 769px) { .sidebar { box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 6%, transparent) } }
:root[data-theme="light"] :is(.bubble, .pop, .skills-popover, form.composer) { box-shadow: inset 0 1px 0 #ffffffb3, 0 6px 18px -12px #0003 }
.presence::before { transition: width 220ms var(--ease-spring, ease), height 220ms var(--ease-spring, ease), border-radius 220ms var(--ease-spring, ease), background-color 220ms ease, border-color 220ms ease, box-shadow 220ms ease }
.presence.working::before { width: 6px; height: 6px; border-radius: 50%; background-color: var(--honey); animation: hub-orbit-pulse 1.6s cubic-bezier(.2, .6, .35, 1) infinite }
.connection[data-agent="working"]::before { animation: hub-orbit-pulse 1.6s cubic-bezier(.2, .6, .35, 1) infinite }
@keyframes hub-orbit-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--honey) 70%, transparent), 0 0 6px color-mix(in srgb, var(--honey) 55%, transparent) }
  70% { box-shadow: 0 0 0 5px transparent, 0 0 6px color-mix(in srgb, var(--honey) 35%, transparent) }
  100% { box-shadow: 0 0 0 5px transparent, 0 0 6px color-mix(in srgb, var(--honey) 55%, transparent) }
}
form.composer { position: relative; transition: border-color 220ms ease, box-shadow 220ms ease }
/* V2: clean border highlight only (focus, hover, typing or dictation) — no sweeps or waves */
form.composer:hover { border-color: color-mix(in srgb, var(--text) 22%, var(--rim-2)) }
form.composer:focus-within, form.composer.recording { border-color: color-mix(in srgb, var(--honey) 55%, var(--rim-2)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--honey) 18%, transparent) }
form.composer::after { content: none }
@keyframes hub-composer-sweep { 0% { opacity: 0; background-position: 120% 0 } 15%, 85% { opacity: 1 } 100% { opacity: 0; background-position: -20% 0 } }
.access-menu[open] > .access-options, .code-card { animation: hub-spring-open 220ms cubic-bezier(.34, 1.56, .64, 1) 1 both }
@keyframes hub-spring-open { from { opacity: 0; transform: translateY(-4px) } to { opacity: 1; transform: none } }
@media (prefers-reduced-motion: reduce) {
  .cockpit-logo, .cockpit-card, .access-menu[open] > .access-options, .code-card, form.composer:focus-within::after { animation: none }
  .cockpit-card, .presence::before, form.composer { transition: none }
  .cockpit-card:hover { transform: none }
  .presence.working::before, .connection[data-agent="working"]::before { animation: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--honey) 35%, transparent) }
}

/* Skill picker: origin filters, badges, favorites (V2) */
.skills-origin { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 6px; margin-top: 6px }
.skills-origin::-webkit-scrollbar { display: none }
.skills-origin .chip { flex: none; display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--rim); background: transparent; color: var(--muted, inherit); cursor: pointer; transition: background-color .16s ease, border-color .16s ease, color .16s ease }
.skills-origin .chip .i { width: 13px; height: 13px }
.skills-origin .chip[aria-pressed="true"] { border-color: var(--accent, #f5b43c); color: var(--text, inherit); background: color-mix(in srgb, var(--accent, #f5b43c) 16%, transparent) }
.skills-group { display: block; padding: 8px 6px 2px; font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; color: var(--faint) }
.skill-origin[data-origin="github"] { color: #9ecbff; border-color: color-mix(in srgb, #9ecbff 40%, transparent) }
.skill-origin[data-origin="downloaded"] { color: #b9e6a8; border-color: color-mix(in srgb, #b9e6a8 40%, transparent) }
.skill-origin[data-origin="built-in"] { color: var(--accent, #f5b43c); border-color: color-mix(in srgb, var(--accent, #f5b43c) 40%, transparent) }
.skill-star { flex: none; width: 28px; height: 28px; display: inline-grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--faint); cursor: pointer; transition: color .16s ease, transform .16s ease }
.skill-star .i { width: 15px; height: 15px }
.skill-star:hover { color: var(--text, inherit) }
.skill-star[aria-pressed="true"] { color: var(--accent, #f5b43c) }
.skill-star:active { transform: scale(.9) }
@media (max-width: 768px) { .skill-source.skill-origin { display: inline-block; max-width: 74px; font-size: .62rem; padding: 0 5px } }
@media (prefers-reduced-motion: reduce) { .skills-origin .chip, .skill-star { transition: none } }

/* ===== V2 Royal Charcoal (step 323) ===== */
:root {
  --rc-void: #08090b;
  --rc-surface-1: #1e1f22;
  --rc-surface-2: linear-gradient(180deg, #1e2023, #26282c);
  --rc-surface-3: #2c2e33;
  --rc-edge: #4c4e51;
  --rc-amber: #fbbf24;
  --rc-indigo: #60a5fa;
  --rc-emerald: #34d399;
  --rc-coral: #f87171;
  --rc-bloom: 0 0 24px #ffffff14;
  --rc-hi: inset 0 1px 0 #ffffff14;
  --rc-metal: linear-gradient(90deg, #2c2e33, #3a3c41 55%, #26282c);
  --rc-gleam: linear-gradient(115deg, transparent 30%, #ffffff12 46%, #ffffff05 54%, transparent 66%);
  --rc-bar: #ffffff;
  --rc-bar-glow: 0 0 8px #ffffffb3, 0 0 18px #ffffff40;
  --rc-spot: radial-gradient(120% 70% at 30% 0, #ffffff0a, transparent 60%);
  --rc-float-shadow: 0 24px 60px #000000b3, 0 0 0 1px #ffffff05, 0 0 32px #ffffff0d;
  --rc-spring: cubic-bezier(.34, 1.4, .64, 1);
  --rc-dur: 200ms;
}
:root[data-theme="obsidian"], :root:not([data-theme]) {
  --ink: #08090b;
  --panel: #111215;
  --panel-2: #1e1f22;
  --raised: #26282c;
  --rim: #2f3136;
  --rim-2: #47484c;
}
:root[data-theme="obsidian"], :root:not([data-theme]), :root[data-theme=oled] {
  --text: #f4f5f7;
  --dim: #8e9299;
  --faint: #5c6068;
  --green: #34d399;
  --green-ink: #0f2a20;
  --honey: #e8eaee;
  --red: #f87171;
}
:root[data-theme=oled] {
  --rc-void: #000000;
  --rc-surface-1: #050506;
  --rc-surface-2: linear-gradient(180deg, #050506, #0b0b0d);
  --rc-surface-3: #0b0b0d;
  --rc-edge: #222229;
  --rc-metal: linear-gradient(90deg, #111214, #1c1d20 55%, #0b0b0d);
  --rc-spot: none;
}
:root[data-theme="light"], :root[data-theme="contrast"] {
  --rc-void: var(--ink);
  --rc-surface-1: var(--panel-2);
  --rc-surface-2: var(--panel);
  --rc-surface-3: var(--raised);
  --rc-edge: var(--rim);
  --rc-bloom: 0 0 0 transparent;
  --rc-hi: inset 0 0 0 transparent;
  --rc-metal: var(--raised);
  --rc-gleam: none;
  --rc-bar: var(--text);
  --rc-bar-glow: none;
  --rc-spot: none;
}
:root[data-theme="light"] { --rc-float-shadow: 0 12px 32px #0000001f }
:root[data-theme="contrast"] { --rc-float-shadow: none }

.shell { background: radial-gradient(90% 60% at 0 0, #ffffff08, transparent 55%), var(--rc-void) }
:root[data-theme="light"] .shell, :root[data-theme="contrast"] .shell { background: var(--ink) }
.sidebar {
  background: var(--rc-spot), var(--panel);
  border-color: var(--rim);
  box-shadow: inset 0 1px 0 #4c4e5159;
}
.rail { box-shadow: inset 0 1px 0 #4c4e5140 }
.rail-button svg { stroke-width: 1.5 }
.rail-button {
  position: relative;
  transition: transform .12s ease-out, background-color var(--rc-dur) var(--rc-spring),
    border-color var(--rc-dur) var(--rc-spring), color var(--rc-dur) var(--rc-spring), box-shadow var(--rc-dur) var(--rc-spring);
}
.rail-button[aria-current=true] {
  color: var(--text);
  background: var(--rc-metal);
  border-color: var(--rim-2);
  box-shadow: var(--rc-hi), var(--rc-bloom);
}
.rail-button[aria-current=true]:not([data-panel="hub"])::after {
  content: "";
  position: absolute;
  right: 3px;
  top: 50%;
  width: 2px;
  height: 14px;
  margin-top: -7px;
  border-radius: 2px;
  background: var(--rc-bar);
  box-shadow: var(--rc-bar-glow);
  pointer-events: none;
}
.rail-button[data-panel="hub"][aria-current=true] {
  background: linear-gradient(var(--rc-bar), var(--rc-bar)) right 3px center / 2px 14px no-repeat, var(--rc-metal);
}

.chat-row { transition: background-color 160ms var(--rc-spring), box-shadow 160ms var(--rc-spring) }
.chat-row:hover { background: #ffffff08 }
.chat-row[aria-current=true] {
  background: var(--rc-metal);
  box-shadow: var(--rc-hi), inset 0 0 0 1px #ffffff0a;
  isolation: isolate;
}
.chat-row[aria-current=true]::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--rc-gleam);
  pointer-events: none;
  z-index: -1;
}
.chat-row[aria-current=true]::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 2px;
  height: 14px;
  margin-top: -7px;
  border-radius: 2px;
  background: var(--rc-bar);
  box-shadow: var(--rc-bar-glow);
  pointer-events: none;
}

.panel-sheet, .cockpit-card, .stat, .worker-card, .plan-card, .file-card, .code-card, .login-card {
  background: var(--rc-surface-2);
  border: 1px solid var(--rim);
  border-radius: 14px;
  box-shadow: var(--rc-hi);
}
.panel-sheet, .login-card { border-radius: 16px }
.pop, .skills-popover, .palette-box, .sheet-dialog {
  background: var(--rc-surface-2);
  border: 1px solid var(--rim-2);
  border-radius: 20px;
  box-shadow: var(--rc-hi), var(--rc-float-shadow);
}
.mark { color: var(--text); background: var(--rc-surface-2); box-shadow: var(--rc-hi) }

button {
  transition: transform .12s ease-out, background-color 160ms var(--rc-spring), border-color 160ms var(--rc-spring),
    color 160ms var(--rc-spring), box-shadow 180ms var(--rc-spring);
}
.primary { color: #111215; background: #f4f5f7; border-color: #f4f5f7; box-shadow: inset 0 1px 0 #ffffff }
.primary:hover:enabled { color: #111215; background: #ffffff; border-color: #ffffff; box-shadow: 0 0 0 1px #ffffff26, 0 0 22px #ffffff38 }
.secondary, .chip { background: var(--rc-surface-1); border-color: var(--rim) }
.secondary:hover:enabled, .chip:hover:enabled, .chip:hover { background: var(--raised); border-color: var(--rim-2) }
button[aria-pressed=true] { color: var(--text); border-color: var(--rim-2); background: var(--raised); box-shadow: var(--rc-hi), 0 0 0 1px #f4f5f71f }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px }
#login-status { color: var(--dim) }

.presence.working { color: var(--rc-emerald); background-color: var(--rc-emerald); border-color: var(--rc-emerald) }
.presence.awaiting { color: var(--rc-amber); background-color: var(--rc-amber); border-color: var(--rc-amber) }
.presence.lost { color: var(--rc-coral); background-color: var(--rc-coral); border-color: var(--rc-coral) }
.presence.listening { color: var(--rc-indigo); background-color: var(--rc-indigo); border-color: var(--rc-indigo) }
.presence.working { animation: rc-breathe 1.8s ease-in-out infinite }
@keyframes rc-breathe {
  0%, 100% { box-shadow: 0 0 0 0 #34d39966 }
  50% { box-shadow: 0 0 0 4px #34d39900, 0 0 10px #34d39959 }
}
.live-dot { background-color: var(--rc-emerald); color: var(--rc-emerald); box-shadow: 0 0 8px #34d39966 }

.rc-ticker {
  display: flex;
  align-items: center;
  gap: 0;
  height: 28px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  padding: 0 4px;
  border: 1px solid var(--rim);
  border-radius: 999px;
  background: var(--rc-surface-1);
  box-shadow: var(--rc-hi);
  font-size: .76rem;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent);
}
.rc-tick { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 10px; color: var(--dim); flex: none }
.rc-tick + .rc-tick { border-left: 1px solid var(--rim) }
.rc-tick b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums }
.rc-tick[data-tone="ok"] b { color: var(--rc-emerald) }
.rc-tick[data-tone="wait"] b { color: var(--rc-amber) }
.rc-tick[data-tone="error"] b { color: var(--rc-coral) }
.rc-tick[data-tone="info"] b { color: var(--rc-indigo) }
@media (max-width: 768px) { .rc-ticker { display: none } }

.rc-bento { display: grid; gap: 10px; min-height: 0; height: 100%; grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(0, 1fr) }
.rc-bento[data-layout="single"] { grid-template-columns: minmax(0, 1fr) }
.rc-bento[data-layout="split"] { grid-template-columns: repeat(2, minmax(0, 1fr)) }
.rc-bento[data-layout="bento3"] { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)) }
.rc-bento[data-layout="bento3"] > .rc-pane:first-child { grid-row: span 2 }
.rc-bento[data-layout="bento4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)) }
.rc-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--rc-surface-2);
  border: 1px solid var(--rim);
  border-radius: 14px;
  box-shadow: var(--rc-hi);
  transition: border-color var(--rc-dur) var(--rc-spring), box-shadow var(--rc-dur) var(--rc-spring);
}
.rc-pane[aria-current=true], .rc-pane:focus-within { border-color: var(--rim-2); box-shadow: var(--rc-hi), var(--rc-bloom) }
.rc-pane-head { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px; border-bottom: 1px solid var(--rim); flex: none }
.rc-pane-head > :first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: .86rem }
.rc-pane-body { flex: 1; min-height: 0; overflow: auto; padding: 10px 12px }
.rc-seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--rim); border-radius: 10px; background: var(--rc-void); box-shadow: inset 0 1px 2px #00000066 }
.rc-seg button {
  min-height: 28px;
  padding: 0 10px;
  border-color: transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--dim);
  transition: background-color var(--rc-dur) var(--rc-spring), color var(--rc-dur) var(--rc-spring),
    box-shadow var(--rc-dur) var(--rc-spring), transform var(--rc-dur) var(--rc-spring);
}
.rc-seg button:hover:enabled { background: #ffffff08; border-color: transparent; color: var(--text) }
.rc-seg button[aria-pressed=true] {
  color: var(--text);
  background: var(--rc-metal);
  border-color: var(--rim-2);
  box-shadow: var(--rc-hi), var(--rc-bloom);
  animation: rc-seg-in 220ms var(--rc-spring);
}
@keyframes rc-seg-in { from { transform: scale(.92) } to { transform: scale(1) } }
@media (max-width: 768px) {
  .rc-bento, .rc-bento[data-layout] { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-rows: minmax(0, 1fr) }
  .rc-bento[data-layout] > .rc-pane:first-child { grid-row: auto }
  .rc-bento[data-layout] > .rc-pane:not(:first-child) { display: none }
}

@media (prefers-reduced-motion: reduce) {
  .rail-button, .chat-row, button, .rc-pane, .rc-seg button { transition: none }
  .presence.working, .rc-seg button[aria-pressed=true] { animation: none }
}

/* ===== «Карта чатов» (Chat Map) ===== */
.map-panel:not([hidden]) { display: flex; flex-direction: column; gap: 10px; min-height: 0 }
.map-panel[hidden] { display: none }
.map-stage {
  position: relative; flex: 1; min-height: 0; background: #08090b; border-radius: 16px;
  border: 1px solid #2f3136; overflow: hidden; cursor: grab; touch-action: none; user-select: none;
  -webkit-user-select: none; outline: none;
}
.map-stage:focus-visible { box-shadow: 0 0 0 2px rgba(244, 245, 247, .55) }
.map-stage.is-panning { cursor: grabbing }
.map-svg { display: block; width: 100%; height: 100%; font-family: "Segoe UI", system-ui, -apple-system, sans-serif }
.map-node text { pointer-events: none }
.map-node.is-chat { cursor: pointer }
.map-node .map-card { transition: filter .16s ease }
.map-node.is-chat:hover .map-card, .map-node.is-chat:focus-visible .map-card { filter: brightness(1.18) }
.map-node.is-chat:focus { outline: none }
.map-node.is-chat:focus-visible .map-card { stroke: #f4f5f7 }
.map-hud {
  position: absolute; left: 16px; bottom: 14px; z-index: 1; pointer-events: none; white-space: pre;
  font: 500 11.5px/1.4 ui-monospace, "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
  color: #8e9299; letter-spacing: .02em;
}
.map-glass {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 1;
  width: min(520px, calc(100% - 340px)); min-width: 240px; padding: 10px 14px; box-sizing: border-box;
  background: rgba(30, 31, 34, .72); border: 1px solid #47484c; border-radius: 16px;
  box-shadow: inset 0 1px 0 #4c4e51, 0 12px 32px rgba(0, 0, 0, .45);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); cursor: default;
}
.map-glass-label { display: block; color: #5c6068; font-size: .72rem; margin-bottom: 2px }
.map-glass p { margin: 0; color: #f4f5f7; font-size: .82rem; line-height: 1.4 }
@media (max-width: 768px) {
  .map-stage { border-radius: 12px }
  .map-hud { font-size: 10px; left: 10px; bottom: 10px }
  .map-glass { display: none }
}
@media (prefers-reduced-motion: reduce) {
  .map-node .map-card { transition: none }
  .map-pulse { display: none }
}

/* ===================== «Скиллы и Проводник» ===================== */
.explorer-panel { display: flex; flex-direction: column; min-height: 0; }
.explorer-panel[hidden] { display: none; }
.explorer-panel .ex-count-total { color: #8e9299; font-variant-numeric: tabular-nums; }
.ex-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 240px 1fr; overflow: hidden; }
.ex-side { display: flex; flex-direction: column; gap: 12px; padding: 14px 12px; border-right: 1px solid #2f3136; min-height: 0; overflow-y: auto; background: radial-gradient(120% 60% at 0 0, #ffffff08, transparent 60%); }
.ex-main { min-width: 0; min-height: 0; overflow-y: auto; padding: 18px 22px 28px; background-image: radial-gradient(#ffffff0a 1px, transparent 1px); background-size: 24px 24px; }
.ex-title { margin: 6px 0 12px; font-size: 18px; font-weight: 600; color: #f4f5f7; }
.ex-main .ex-title + .ex-folders { margin-bottom: 22px; }
#explorer-search { width: 100%; border-radius: 8px; }

.ex-seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 10px; background: #08090b; border: 1px solid #2f3136; isolation: isolate; }
.ex-seg::before { content: ""; position: absolute; z-index: -1; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 8px; background: linear-gradient(#2c2e33, #26282c); box-shadow: inset 0 1px 0 #4c4e51, 0 2px 8px #0006; transition: transform 340ms cubic-bezier(.34,1.56,.64,1); }
.ex-seg[data-mode="tags"]::before { transform: translateX(100%); }
.ex-seg button { appearance: none; border: 0; background: transparent; color: #8e9299; font: inherit; font-size: 13px; padding: 7px 0; border-radius: 8px; cursor: pointer; transition: color 160ms ease; }
.ex-seg button[aria-pressed="true"] { color: #f4f5f7; }
.ex-seg button:focus-visible { outline: 2px solid #f4f5f7; outline-offset: -2px; }

.ex-tree ul { list-style: none; margin: 0; padding: 0; }
.ex-tree-children { margin-left: 15px; padding-left: 12px; }
.ex-tree-item { position: relative; }
.ex-tree-children > .ex-tree-item::before { content: ""; position: absolute; left: -12px; top: 0; height: 50%; width: 9px; border-left: 1px solid #2f3136; border-bottom: 1px solid #2f3136; border-bottom-left-radius: 6px; pointer-events: none; }
.ex-tree-children > .ex-tree-item:not(:last-child)::after { content: ""; position: absolute; left: -12px; top: 50%; bottom: 0; border-left: 1px solid #2f3136; pointer-events: none; }
.ex-tree-btn { appearance: none; width: 100%; display: flex; align-items: center; gap: 8px; margin: 1px 0; padding: 6px 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #8e9299; font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; transition: background-color 140ms ease, color 140ms ease; }
.ex-tree-btn:hover { background: #ffffff08; color: #f4f5f7; }
.ex-tree-btn[aria-pressed="true"] { background: linear-gradient(#26282c, #1e2023); color: #f4f5f7; border-color: #2f3136; box-shadow: inset 0 1px 0 #4c4e51; }
.ex-tree-btn:focus-visible { outline: 2px solid #f4f5f7; outline-offset: 1px; }
.ex-tree-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-tree-count { min-width: 22px; padding: 1px 6px; border-radius: 6px; background: #2c2e33; color: #f4f5f7; font-size: 11.5px; text-align: center; font-variant-numeric: tabular-nums; }
.ex-tree-btn[aria-pressed="true"] .ex-tree-count { background: #47484c; }

.ex-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 12px; }
.ex-folder { appearance: none; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 12px 14px; border: 1px solid transparent; border-radius: 16px; background: transparent; color: #f4f5f7; font: inherit; cursor: pointer; transition: background-color 160ms ease, border-color 160ms ease; }
.ex-folder:hover { background: #ffffff06; }
.ex-folder[aria-pressed="true"] { background: linear-gradient(#1e2023, #1e1f22); border-color: #2f3136; box-shadow: inset 0 1px 0 #4c4e51; }
.ex-folder:focus-visible { outline: 2px solid #f4f5f7; outline-offset: 2px; }
.ex-folder-art { position: relative; width: 148px; height: 108px; margin-bottom: 10px; perspective: 600px; }
.ex-folder-back { position: absolute; left: 0; right: 0; top: 12px; bottom: 0; border-radius: 12px; background: #26282c; box-shadow: inset 0 1px 0 #ffffff0d; }
.ex-folder-back::before { content: ""; position: absolute; left: 0; top: -11px; width: 58px; height: 16px; border-radius: 8px 10px 0 0; background: #26282c; box-shadow: inset 0 1px 0 #ffffff0d; }
.ex-sheet { position: absolute; left: 22px; right: 22px; top: 6px; height: 70px; border-radius: 6px; transform-origin: 50% 100%;
  background: repeating-linear-gradient(to bottom, transparent 0 8px, #00000021 8px 9px) 10px 14px / calc(100% - 20px) 40px no-repeat, #e9eaee;
  box-shadow: 0 1px 2px #0005; transition: transform 420ms cubic-bezier(.34,1.56,.64,1); }
.ex-sheet-1 { transform: translateY(2px) rotate(-3deg); transition-delay: 0ms; }
.ex-sheet-2 { background-color: #d7d9de; transform: translateY(0) rotate(0deg); transition-delay: 16ms; }
.ex-sheet-3 { transform: translateY(3px) rotate(3deg); transition-delay: 32ms; }
.ex-folder-front { position: absolute; left: 0; right: 0; bottom: 0; height: 74%; border-radius: 12px; background: linear-gradient(180deg, #2c2e33, #232528); border-top: 1px solid #4c4e51; box-shadow: 0 10px 24px #0007, inset 0 -1px 0 #0006; transform-origin: 50% 100%; transform: perspective(600px) rotateX(0deg); transition: transform 380ms cubic-bezier(.34,1.56,.64,1); }
.ex-folder:hover .ex-sheet-1, .ex-folder:focus-visible .ex-sheet-1 { transform: translateY(-14px) rotate(-8deg); }
.ex-folder:hover .ex-sheet-2, .ex-folder:focus-visible .ex-sheet-2 { transform: translateY(-14px) rotate(0deg); }
.ex-folder:hover .ex-sheet-3, .ex-folder:focus-visible .ex-sheet-3 { transform: translateY(-14px) rotate(8deg); }
.ex-folder:hover .ex-folder-front, .ex-folder:focus-visible .ex-folder-front { transform: perspective(600px) rotateX(-8deg); }
.ex-folder-name { font-size: 14px; font-weight: 500; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-folder-meta { color: #8e9299; font-size: 12px; }

.ex-badges { position: absolute; left: 10px; bottom: 10px; display: flex; }
.ex-badge { width: 18px; height: 18px; display: inline-grid; place-items: center; border-radius: 50%; background: #111215; border: 1px solid #47484c; color: #f4f5f7; font-size: 7.5px; font-weight: 700; letter-spacing: -.02em; line-height: 1; box-shadow: 0 0 0 2px #232528; }
.ex-badge + .ex-badge { margin-left: -4px; }
.ex-badge[data-origin="github"] { background: #f4f5f7; color: #111215; border-color: #ffffff; }
.ex-badge[data-origin="downloaded"] { color: #60a5fa; border-color: #60a5fa80; }
.ex-badge[data-origin="local"] { color: #34d399; border-color: #34d39980; }
.ex-badge[data-origin="built-in"] { color: #8e9299; border-color: #5c6068; }

.ex-table-wrap { overflow-x: auto; border: 1px solid #2f3136; border-radius: 14px; background: #111215; }
.ex-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ex-table th { padding: 10px 14px; text-align: left; font-weight: 500; font-size: 12px; color: #8e9299; border-bottom: 1px solid #2f3136; white-space: nowrap; }
.ex-table td { padding: 9px 14px; border-top: 1px solid #2f3136; vertical-align: middle; color: #f4f5f7; }
.ex-table tbody tr:first-child td { border-top: 0; }
.ex-table tbody tr { transition: background-color 120ms ease; }
.ex-table tbody tr:hover { background: #ffffff08; }
.ex-table tbody tr[aria-selected="true"] { background: #ffffff0d; box-shadow: inset 2px 0 0 #f4f5f7; }
.ex-row.off .ex-name { color: #8e9299; }
.ex-name { appearance: none; display: inline-flex; align-items: center; gap: 6px; border: 0; padding: 2px 4px; margin-left: -4px; border-radius: 6px; background: transparent; color: #f4f5f7; font: inherit; font-family: ui-monospace, "JetBrains Mono", "Cascadia Code", Consolas, monospace; font-size: 13px; cursor: pointer; white-space: nowrap; }
.ex-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.ex-name:focus-visible { outline: 2px solid #f4f5f7; outline-offset: 1px; }
.ex-name .i { width: 12px; height: 12px; color: #fbbf24; }
.ex-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; border: 1px solid #2f3136; background: #1e1f22; color: #8e9299; font-size: 12px; white-space: nowrap; }
.ex-status { display: inline-flex; align-items: center; gap: 6px; color: #8e9299; font-size: 12.5px; white-space: nowrap; }
.ex-dot { width: 6px; height: 6px; border-radius: 50%; background: #5c6068; }
.ex-status[data-on="true"] { color: #f4f5f7; }
.ex-status[data-on="true"] .ex-dot { background: #34d399; box-shadow: 0 0 6px #34d39980; }
.ex-path { max-width: 280px; }
.ex-path-text { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #8e9299; font-family: ui-monospace, "JetBrains Mono", Consolas, monospace; font-size: 12px; direction: rtl; text-align: left; }
.ex-tags { display: block; color: #5c6068; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-empty { display: block; margin: 10px 2px; color: #8e9299; }
.ex-empty:empty { display: none; }

.ex-preview { margin-top: 18px; padding: 14px; border: 1px solid #2f3136; border-radius: 16px; background: linear-gradient(#1e2023, #1e1f22); box-shadow: inset 0 1px 0 #4c4e51, 0 12px 30px #0006; }
.ex-preview[hidden] { display: none; }
.ex-preview-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ex-preview-head strong { font-family: ui-monospace, "JetBrains Mono", Consolas, monospace; }
.ex-preview-head small { color: #8e9299; }
.ex-preview-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.ex-preview-status { display: block; min-height: 1em; margin-bottom: 8px; color: #8e9299; font-size: 12px; }
.ex-preview-status:empty { display: none; }
.ex-pre { margin: 0; max-height: 380px; overflow: auto; padding: 14px 16px; border-radius: 12px; background: #0b0c0e; border: 1px solid #2f3136; color: #f4f5f7; font-family: ui-monospace, "JetBrains Mono", "Cascadia Code", Consolas, monospace; font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }

@media (max-width: 768px) {
  .ex-body { grid-template-columns: 1fr; overflow-y: auto; }
  .ex-side { border-right: 0; border-bottom: 1px solid #2f3136; overflow: visible; }
  .ex-main { overflow: visible; padding: 14px 12px 24px; }
  .ex-tree { overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px; }
  .ex-tree-list { display: flex; gap: 6px; width: max-content; }
  .ex-tree-children { display: contents; }
  .ex-tree-item { display: contents; }
  .ex-tree-children > .ex-tree-item::before, .ex-tree-children > .ex-tree-item::after { display: none; }
  .ex-tree-btn { width: auto; white-space: nowrap; border-color: #2f3136; border-radius: 999px; padding: 5px 10px; }
  .ex-tree-btn .i { display: none; }
  .ex-folders { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .ex-folder-art { width: 120px; height: 88px; }
  .ex-sheet { height: 56px; left: 18px; right: 18px; }
  .ex-path { max-width: 160px; }
}

@media (prefers-reduced-motion: reduce) {
  .explorer-panel *, .explorer-panel *::before, .explorer-panel *::after { transition: none !important; }
  .ex-folder:hover .ex-sheet, .ex-folder:focus-visible .ex-sheet,
  .ex-folder:hover .ex-folder-front, .ex-folder:focus-visible .ex-folder-front { transform: none; }
  .ex-sheet-1, .ex-sheet-2, .ex-sheet-3 { transform: none; }
}
/* =================== end «Скиллы и Проводник» =================== */

/* ===== V2 art: dither canvas, «Что вы создадите?» card, Snink loading card ===== */
.rc-art-host { position: relative; isolation: isolate; }
:where(.rc-art-host > :not(.rc-art)) { position: relative; z-index: 1; }
.rc-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: .55;
  pointer-events: none;
  z-index: 0;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 60% 45%, #000 40%, transparent 100%);
  mask-image: radial-gradient(ellipse 75% 70% at 60% 45%, #000 40%, transparent 100%);
}

.rc-create {
  position: absolute;
  left: clamp(16px, 3vw, 40px);
  bottom: clamp(16px, 3vw, 40px);
  z-index: 1;
  display: flex;
  gap: 3px;
  pointer-events: none;
  user-select: none;
}
.rc-create > span {
  background: #141518;
  border-radius: 16px;
  padding: 18px 72px 18px 22px;
  color: #fff;
  font-size: 15px;
  line-height: 1.15;
  font-weight: 600;
}
.rc-create-mark {
  display: block;
  width: 64px;
  border-radius: 16px;
  background-color: #141518;
  background-image: linear-gradient(#fff, #fff), linear-gradient(#fff, #fff);
  background-size: 14px 14px;
  background-repeat: no-repeat;
  background-position: calc(50% - 7px) calc(50% - 7px), calc(50% + 7px) calc(50% + 7px);
}

.setting-select {
  flex: 0 0 auto;
  max-width: 52%;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #2f3136;
  border-radius: 8px;
  background: #1e1f22;
  color: #f4f5f7;
  font: inherit;
  font-size: 13px;
}
.setting-select:focus-visible { outline: 2px solid #f4f5f7; outline-offset: 2px; }

#rc-loading {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    linear-gradient(90deg, #ffffff08 1px, transparent 1px) 50% 50% / 120px 120px,
    linear-gradient(#ffffff08 1px, transparent 1px) 50% 50% / 120px 120px,
    repeating-conic-gradient(#0b0c0e 0 25%, #121316 0 50%) 50% 50% / 120px 120px,
    #000;
}
#rc-loading::before,
#rc-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#rc-loading::before { background: radial-gradient(ellipse 55% 42% at 50% 48%, #ffffff1f, #ffffff08 45%, transparent 72%); }
#rc-loading::after { background: radial-gradient(ellipse at 50% 50%, transparent 38%, #000000d9 92%); }

.rc-load-card {
  position: relative;
  z-index: 1;
  width: min(420px, 92vw);
  padding: 22px;
  border-radius: 22px;
  background: linear-gradient(180deg, #0e0f11, #151619);
  border: 1px solid #47484c;
  box-shadow: inset 0 1px 0 #ffffff12, 0 0 0 1px #00000080, 0 30px 80px #000, 0 0 60px #ffffff10;
  color: #f4f5f7;
  animation: rc-load-in 320ms cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes rc-load-in {
  0% { opacity: 0; transform: scale(.96); }
  60% { opacity: 1; transform: scale(1.01); }
  100% { opacity: 1; transform: scale(1); }
}
.rc-load-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ffffff14;
  color: #f4f5f7;
  cursor: pointer;
}
.rc-load-close:hover { background: #ffffff24; }
.rc-load-close:focus-visible { outline: 2px solid #f4f5f7; outline-offset: 2px; }
.rc-load-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  margin: 12px 40px 20px 0;
}
.rc-load-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 30%;
  background: linear-gradient(160deg, #26282c, #111215);
  border: 1px solid #47484c;
  box-shadow: inset 0 1px 0 #ffffff1a;
  color: #f4f5f7;
}
.rc-load-text { display: grid; gap: 3px; min-width: 0; }
.rc-load-title {
  font-size: 19px;
  font-weight: 500;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rc-load-sub { color: #5c6068; font-size: 13px; font-variant-numeric: tabular-nums; }
.rc-load-panel {
  display: grid;
  gap: 12px;
  padding: 14px 16px 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, #0a0b0d, #111215);
  border: 1px solid #2f3136;
  box-shadow: inset 0 1px 0 #ffffff0a;
}
.rc-load-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rc-load-status { font-size: 14px; color: #f4f5f7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-load-spin {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid;
  border-color: #f4f5f7 #f4f5f7 #f4f5f7 transparent;
  box-sizing: border-box;
  animation: rc-spin 1s linear infinite;
}
@keyframes rc-spin { to { transform: rotate(360deg); } }
.rc-load-track {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: #2a2c30;
}
.rc-load-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #fff;
  box-shadow: 0 0 12px #ffffffaa;
  transition: width 240ms cubic-bezier(.2, .8, .2, 1);
}
.rc-load-track.is-indeterminate .rc-load-fill {
  width: 32%;
  transition: none;
  animation: rc-slide 1.3s ease-in-out infinite alternate;
}
@keyframes rc-slide { from { transform: translateX(0); } to { transform: translateX(212.5%); } }

@media (max-width: 400px) {
  .rc-load-card { padding: 16px; border-radius: 20px; }
  .rc-load-head { gap: 12px; margin: 8px 36px 16px 0; }
  .rc-load-icon { width: 44px; height: 44px; }
  .rc-load-title { font-size: 16px; }
  .rc-load-panel { padding: 12px; }
  .rc-create > span { padding: 14px 40px 14px 16px; font-size: 13px; }
  .rc-create-mark { width: 52px; background-size: 11px 11px; background-position: calc(50% - 5.5px) calc(50% - 5.5px), calc(50% + 5.5px) calc(50% + 5.5px); }
}
@media (max-height: 520px) { .rc-create { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .rc-load-card { animation: none; }
  .rc-load-spin { animation: none; }
  .rc-load-fill { transition: none; }
  .rc-load-track.is-indeterminate .rc-load-fill { animation: none; transform: translateX(106%); }
}

/* @@W1-START (owned by web agent W1; put all new CSS for your task between these markers) */
/* Royal Charcoal unified palette: bg #08090b / panel #111215 / card #1e2023 / 1px #2f3136 */
:root:not([data-theme]), :root[data-theme=obsidian] {
  --ink: #08090b;
  --panel: #111215;
  --panel-2: #1e2023;
  --raised: #26282c;
  --rim: #2f3136;
  --rim-2: #47484c;
  --rc-void: #08090b;
  --rc-surface-1: #1e2023;
  --rc-surface-2: #1e2023;
  --rc-hi: inset 0 1px 0 rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .06);
}
:root {
  --rc-violet: #a855f7;
  --rc-blue: #4f46e5;
  --rc-spec: linear-gradient(90deg, transparent, #4f46e5 8%, #a855f7 28%, #ffffff 50%, #a855f7 72%, #4f46e5 92%, transparent);
}
.panel-sheet, .cockpit-card, .stat, .worker-card, .plan-card, .file-card, .code-card { border: 1px solid var(--rim); box-shadow: var(--rc-hi) }

/* Typography polish */
body { text-rendering: optimizeLegibility; -moz-osx-font-smoothing: grayscale; font-feature-settings: "cv11", "ss01" }
h1, h2, h3 { letter-spacing: -.012em; font-weight: 650; text-wrap: balance }
.panel-head strong, .code-head strong, .skills-head strong { letter-spacing: -.005em; font-weight: 600 }
.eyebrow, .settings-group { letter-spacing: .06em; text-transform: uppercase; font-size: .7rem; font-weight: 600; color: var(--faint) }
small { line-height: 1.45 }
.task-time, .plan-count, .code-count, #upload-progress { font-variant-numeric: tabular-nums }
p { text-wrap: pretty }

/* Login: Fog1ch Hub MCP badge + rest-specular card */
.login { background: radial-gradient(60% 45% at 50% 30%, rgba(124, 92, 246, .07), transparent 70%), var(--ink) }
.login-card {
  position: relative;
  isolation: isolate;
  gap: 14px;
  padding: 32px 28px 28px;
  background: #111215;
  border: 1px solid #2f3136;
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 24px 60px rgba(0, 0, 0, .55);
}
.login-card::before, .login-card::after {
  content: "";
  position: absolute;
  top: -1px;
  left: 22.5%;
  width: 55%;
  height: 1px;
  border-radius: 1px;
  background: var(--rc-spec);
  pointer-events: none;
}
.login-card::after { height: 6px; top: -3px; filter: blur(5px); opacity: .55; z-index: -1 }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px }
.login-logo { display: block; flex: none; width: 52px; height: 52px; filter: drop-shadow(0 6px 16px rgba(99, 70, 229, .35)) drop-shadow(0 0 1px rgba(168, 85, 247, .6)) }
.login-wordmark { font-size: 1.45rem; font-weight: 700; letter-spacing: -.025em; line-height: 1; color: var(--text) }
.login-wordmark-sub { margin-left: 4px; font-size: .62em; font-weight: 500; letter-spacing: .02em; color: var(--text); opacity: .5 }
.login-card h1 { font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; color: var(--text) }
.login-card p { font-size: .88rem; line-height: 1.55; color: var(--dim) }
.login-card label { font-size: .8rem; font-weight: 500; color: var(--dim); letter-spacing: .01em }
.login-card input { background: #08090b; border-color: #2f3136; border-radius: 10px }
.login-card input:focus-visible { border-color: #5b4fd6; box-shadow: 0 0 0 3px rgba(168, 85, 247, .16) }
.login-card button.primary { border-radius: 10px }
:root[data-theme=oled] .login-card { background: #000000; border-color: #17171c }
:root[data-theme="light"] .login-card { background: var(--panel); border-color: var(--rim); box-shadow: 0 12px 32px rgba(0, 0, 0, .08) }
:root[data-theme="light"] .login-card::after { opacity: .3 }
:root[data-theme="light"] .login-card input { background: var(--panel-2); border-color: var(--rim) }
:root[data-theme="contrast"] .login-card { background: #000000; border-color: var(--rim) }
:root[data-theme="contrast"] .login-card::after { display: none }
:root[data-theme="contrast"] .login-card input { background: #000000; border-color: var(--rim) }
:root[data-theme="contrast"] .login-wordmark-sub { opacity: .8 }
/* @@W1-END */

/* @@W2-START (owned by web agent W2; put all new CSS for your task between these markers) */
/* Chat feed cards: «Вы» vs «Агент», 12px radius, 1px top light edge (Royal Charcoal). */
.bubble { position: relative }
.bubble.operator { border-radius: 12px }
.msg-who { display: block; margin-bottom: 3px; font-size: .72rem; font-weight: 650; letter-spacing: .02em; color: var(--faint) }
.bubble.operator .msg-who { color: #a9b4cc }
:is(:root:not([data-theme]), :root[data-theme=obsidian]) .bubble:not(.operator) {
  background: #1e2023; border: 1px solid #2f3136; border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 8px 24px -12px #0009;
}
:is(:root:not([data-theme]), :root[data-theme=obsidian]) .bubble.operator {
  background: #272d3a; border: 1px solid #5b6478; border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), 0 8px 24px -12px #0009;
}
:is(:root:not([data-theme]), :root[data-theme=obsidian]) .has-wallpaper .bubble:not(.operator) { background: color-mix(in srgb, #1e2023 88%, transparent) }
:is(:root:not([data-theme]), :root[data-theme=obsidian]) .has-wallpaper .bubble.operator { background: color-mix(in srgb, #272d3a 92%, transparent) }

/* One-shot entrances; client.js removes the class on animationend. */
@keyframes w2-msg-in-user { from { opacity: 0; transform: translateY(12px) scale(.98) } to { opacity: 1; transform: none } }
@keyframes w2-msg-in-agent { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
@keyframes w2-chip-in { from { opacity: 0; transform: scale(.96) } to { opacity: 1; transform: none } }
/* Cards no longer replay the generic hub-appear on history render / chat switch / stream deltas. */
.feed > .bubble { animation: none }
.feed > .bubble.msg-in-user { transform-origin: 100% 100%; animation: w2-msg-in-user 220ms cubic-bezier(.34, 1.56, .64, 1) both }
.feed > .bubble.msg-in-agent { animation: w2-msg-in-agent 200ms cubic-bezier(.2, .8, .2, 1) both }
.chip-in { transform-origin: 0 50%; animation: w2-chip-in 160ms cubic-bezier(.2, .8, .2, 1) both }

/* Streaming agent card: rest specular on the top edge, gently pulsing; the card only exists while
   the agent streams, so this loop never runs at rest. */
@keyframes w2-stream-pulse { 0%, 100% { opacity: .45 } 50% { opacity: 1 } }
.bubble.is-streaming::after {
  content: ""; position: absolute; top: -1px; left: 22.5%; width: 55%; height: 1px; border-radius: 1px; pointer-events: none;
  background: var(--rc-spec, linear-gradient(90deg, transparent, #4f46e5 8%, #a855f7 28%, #ffffff 50%, #a855f7 72%, #4f46e5 92%, transparent));
  box-shadow: 0 0 6px rgba(168, 85, 247, .45);
  animation: w2-stream-pulse 2400ms ease-in-out infinite; animation-delay: var(--stream-phase, 0ms);
}
@media (prefers-reduced-motion: reduce) {
  .feed > .bubble.msg-in-user, .feed > .bubble.msg-in-agent, .chip-in { animation: none }
  .bubble.is-streaming::after { animation: none; opacity: .8 }
}
/* @@W2-END */

/* @@W3-START (owned by web agent W3; put all new CSS for your task between these markers) */
/* Live Diff button: pen writes +/- lines only while .is-working (the class is dropped when the agent stops). */
.diff-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 6px }
.diff-toggle .w3-pen { width: 18px; height: 18px; flex: none; overflow: visible }
.diff-toggle .w3-ln { stroke-dasharray: 1; stroke-dashoffset: 0 }
.diff-toggle .w3-nib { opacity: 0 }
.diff-toggle.is-working { width: auto; padding: 0 9px; color: var(--text); border-color: var(--rim-2) }
.diff-toggle.is-working .w3-ln { animation: w3-write 2.4s var(--ease-out, ease-out) infinite both }
.diff-toggle.is-working .w3-ln-add { stroke: #3fb950 }
.diff-toggle.is-working .w3-ln-del { stroke: #f85149; animation-delay: .6s }
.diff-toggle.is-working .w3-ln-txt { animation-delay: 1.2s; opacity: .75 }
.diff-toggle.is-working .w3-nib { opacity: 1; animation: w3-nib 2.4s ease-in-out infinite }
@keyframes w3-write { 0% { stroke-dashoffset: 1 } 30%, 82% { stroke-dashoffset: 0; opacity: 1 } 100% { stroke-dashoffset: 0; opacity: 0 } }
@keyframes w3-nib {
  0% { transform: translate(-6px, 4px) } 25% { transform: translate(-3px, 4px) }
  30% { transform: translate(-6px, 8.5px) } 50% { transform: translate(-3px, 8.5px) }
  55% { transform: translate(-1px, 4px) } 75% { transform: translate(1px, 8.5px) } 100% { transform: translate(-6px, 4px) }
}
.w3-diff-live { display: inline-flex; align-items: baseline; font: 600 .72rem/1 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap }
.w3-diff-live[hidden] { display: none }
.w3-diff-live b { display: inline-block; font-weight: 600 }
.w3-diff-live .w3-add { color: #3fb950 }
.w3-diff-live .w3-del { color: #f85149 }
.w3-diff-live .w3-sep { color: var(--faint); white-space: pre }
.w3-roll { animation: w3-roll .32s var(--ease-out, ease-out) 1 both }
@keyframes w3-roll { from { transform: translateY(-70%); opacity: 0 } to { transform: none; opacity: 1 } }

/* Diff panel: only NEW lines slide in (18 ms stagger set inline) and their highlight fades over 1.2 s. */
.diff-line.w3-new { animation: w3-line-in 1.2s linear 1 both }
@keyframes w3-line-in {
  0% { opacity: 0; transform: translateX(-8px); box-shadow: inset 3px 0 0 #e3b341, inset 0 0 0 999px #e3b34129; animation-timing-function: cubic-bezier(.2, .8, .2, 1) }
  18% { opacity: 1; transform: none; box-shadow: inset 3px 0 0 #e3b341, inset 0 0 0 999px #e3b34129; animation-timing-function: ease-out }
  100% { opacity: 1; transform: none; box-shadow: inset 3px 0 0 #e3b34100, inset 0 0 0 999px #e3b34100 }
}

/* ПЛАН: 2-column card grid. */
.plan-panel .w3-plan-grid { grid-template-columns: minmax(280px, 1fr) minmax(0, 1.7fr); align-items: start; gap: 14px }
.plan-panel .w3-plan-grid > .mission-status { grid-column: 1 / -1 }
.w3-plan-col { display: grid; align-content: start; gap: 14px; min-width: 0 }
.plan-panel .w3-card { display: grid; align-content: start; gap: 10px; min-width: 0; padding: 14px; border: 1px solid #2f3136; border-radius: 12px; background: #1e2023 }
.w3-card-head { display: flex; align-items: center; gap: 8px }
.w3-progress-text { margin-left: auto; color: var(--dim); font: .72rem var(--mono); font-variant-numeric: tabular-nums }
.w3-goal-input { width: 100%; min-height: 96px; resize: vertical; box-sizing: border-box; padding: 10px 12px; border: 1px solid #2f3136; border-radius: 8px; background: #111215; color: var(--text); font: inherit; font-size: .9rem; line-height: 1.45 }
.w3-goal-input:focus-visible { outline: none; border-color: #5b6478 }
.plan-panel .plan-task-form { grid-template-columns: 1fr }
.w3-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid #2f3136; border-radius: 8px; background: #111215 }
.w3-chips:focus-within { border-color: #5b6478 }
.w3-chip-list { display: contents }
.w3-chips input { flex: 1 1 120px; min-width: 0; padding: 4px 2px; border: 0; background: none; color: var(--text); font: .78rem var(--mono); outline: none }
.w3-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 2px 4px 2px 8px; border: 1px solid #5b6478; border-radius: 999px; background: #272d3a; color: #a9b4cc; font: .72rem var(--mono) }
.w3-chip > span:not(.w3-glyph) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.w3-chip-x { display: grid; place-items: center; width: 18px; height: 18px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; font-size: .85rem; line-height: 1; cursor: pointer }
.w3-chip-x:hover { background: #ffffff14 }
.w3-exec { display: flex; align-items: center; gap: 8px; padding: 0 0 0 10px; border: 1px solid #2f3136; border-radius: 8px; background: #111215 }
.w3-exec select { flex: 1; min-width: 0; border: 0; background: none }
.w3-glyph { display: inline-block; flex: none; width: 14px; height: 14px; background: currentColor; -webkit-mask: var(--w3-glyph) center / contain no-repeat; mask: var(--w3-glyph) center / contain no-repeat }
.w3-glyph-lock { --w3-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E") }
.w3-glyph-bot { --w3-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='8' width='16' height='12' rx='2'/%3E%3Cpath d='M12 8V4H8M2 14h2M20 14h2M9 13v2M15 13v2'/%3E%3C/svg%3E"); width: 16px; height: 16px; color: #a9b4cc }
.w3-deps { border: 1px solid #2f3136; border-radius: 8px; background: #111215 }
.w3-deps summary { display: flex; align-items: center; gap: 6px; padding: 8px 10px; color: var(--dim); font-size: .8rem; cursor: pointer }
.w3-deps-count { margin-left: auto; color: #a9b4cc; font: .72rem var(--mono) }
.w3-deps-list { display: grid; gap: 2px; max-height: 220px; overflow: auto; padding: 0 6px 8px }
.w3-dep { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-radius: 6px; font-size: .8rem; cursor: pointer }
.w3-dep:hover { background: #ffffff08 }
.w3-dep-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.w3-badge { flex: none; padding: 1px 7px; border: 1px solid #47484c; border-radius: 999px; color: var(--dim); font-size: .66rem; font-weight: 600; line-height: 16px; white-space: nowrap }
.w3-badge[data-status=in_progress] { color: #e3b341; border-color: #e3b34166 }
.w3-badge[data-status=review] { color: #8fa4c7; border-color: #8fa4c766 }
.w3-badge[data-status=blocked] { color: #f85149; border-color: #f8514966 }
.w3-badge[data-status=done] { color: #3fb950; border-color: #3fb95066 }
.w3-progress { height: 6px; overflow: hidden; border-radius: 999px; background: #111215 }
.w3-progress-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4f46e5, #a855f7); transform: scaleX(var(--w3-progress, 0)); transform-origin: left; transition: transform .4s var(--ease-out, ease-out) }
.plan-panel .plan-board { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); overflow: visible; padding-bottom: 0 }
.plan-panel .plan-column { background: #111215 }
.w3-card-top { display: flex; align-items: flex-start; gap: 8px }
.w3-card-top .plan-card-title { flex: 1; min-width: 0 }
.w3-locks { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none }
.w3-lock { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 8px; padding: 6px 8px; border: 1px solid #2f3136; border-radius: 8px; background: #111215; color: var(--dim) }
.w3-lock.held { color: #e3b341; border-color: #e3b34144 }
.w3-lock-path { overflow: hidden; color: var(--text); font: .74rem var(--mono); text-overflow: ellipsis; white-space: nowrap }
.w3-lock-task { grid-column: 2; overflow: hidden; color: var(--faint); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap }
.w3-lock .w3-badge { grid-column: 3; grid-row: 1 / span 2 }
.w3-locks-empty { color: var(--faint); font-size: .78rem; list-style: none }
@media (max-width: 900px) {
  .plan-panel .w3-plan-grid { grid-template-columns: 1fr }
}
@media (prefers-reduced-motion: reduce) {
  .diff-toggle.is-working .w3-ln, .diff-toggle.is-working .w3-nib, .w3-roll, .diff-line.w3-new { animation: none }
  .diff-toggle.is-working .w3-nib { opacity: 0 }
  .w3-progress-fill { transition: none }
}
/* @@W3-END */

/* @@W4-START (owned by web agent W4; put all new CSS for your task between these markers) */
/* Sidebar glass plate: one element behind the active row, moved by client.js movePlate() via --plate-* vars. */
.sidebar.has-plate { position: relative }
.sidebar.has-plate .chat-row { z-index: 1 }
#sidebar.has-plate .chat-row[aria-current=true] { background: none; box-shadow: none }
#sidebar.has-plate .chat-row[aria-current=true]::before, #sidebar.has-plate .chat-row[aria-current=true]::after { content: none }
.nav-plate, .nav-plate-bar { position: absolute; top: 0; left: 0; z-index: 0; pointer-events: none; will-change: transform; transition: opacity 160ms ease }
.nav-plate {
  width: var(--plate-w, 0); height: var(--plate-h, 0); border-radius: 9px; overflow: hidden;
  transform: translate3d(var(--plate-x, 0), var(--plate-y, 0), 0);
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, 0) 60%), rgba(255, 255, 255, .07);
  -webkit-backdrop-filter: blur(10px) saturate(140%); backdrop-filter: blur(10px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 0 0 1px rgba(255, 255, 255, .08), inset 0 -1px 0 rgba(0, 0, 0, .25), 0 6px 18px rgba(0, 0, 0, .35);
  transition: transform 320ms cubic-bezier(.34, 1.56, .64, 1), height 320ms cubic-bezier(.34, 1.56, .64, 1), width 320ms cubic-bezier(.34, 1.56, .64, 1), opacity 160ms ease;
}
.nav-plate::before {
  content: ""; position: absolute; inset: 0; transform: translateX(-130%);
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .16) 48%, rgba(255, 255, 255, .05) 56%, transparent 70%);
}
.nav-plate.sweep::before, .sidebar.has-plate:has(.chat-row[aria-current=true]:hover) .nav-plate::before { animation: w4-sheen 720ms cubic-bezier(.3, .7, .3, 1) 1 }
.nav-plate-bar {
  width: 2px; height: 14px; border-radius: 2px; background: var(--rc-bar, #fff); box-shadow: var(--rc-bar-glow, 0 0 8px #ffffffb3, 0 0 18px #ffffff40);
  transform: translate3d(calc(var(--plate-x, 0px) + var(--plate-w, 0px) - 8px), calc(var(--plate-y, 0px) + var(--plate-h, 0px) / 2 - 7px), 0);
  transition: transform 440ms cubic-bezier(.34, 1.56, .64, 1) 40ms, opacity 160ms ease;
}
.sidebar.plate-instant :is(.nav-plate, .nav-plate-bar) { transition: opacity 160ms ease }
.sidebar.plate-off :is(.nav-plate, .nav-plate-bar) { opacity: 0 }
@keyframes w4-sheen { from { transform: translateX(-130%) } to { transform: translateX(130%) } }

/* Full hide: the column goes to 0 while the sidebar slides out left; visibility flips after the slide. */
.shell { transition: grid-template-columns 260ms cubic-bezier(.2, .8, .2, 1) }
.sidebar { transition: transform 260ms cubic-bezier(.2, .8, .2, 1), opacity 260ms ease, visibility 0s }
.shell.nav-collapsed .sidebar { transform: translateX(-104%); opacity: 0; transition: transform 260ms cubic-bezier(.2, .8, .2, 1), opacity 200ms ease, visibility 0s 260ms }
.shell.nav-collapsed #nav-toggle { display: none }
.sidebar-restore {
  display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid #2f3136; background: rgba(255, 255, 255, .06); color: var(--text); font-size: .8rem; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18); animation: w4-pill-in 220ms cubic-bezier(.34, 1.56, .64, 1) 1 both;
}
.sidebar-restore:hover { background: rgba(255, 255, 255, .1) }
.sidebar-restore[hidden] { display: none }
@keyframes w4-pill-in { from { opacity: 0; transform: translateX(-8px) scale(.96) } to { opacity: 1; transform: none } }

/* Live work: halo + shimmer only while .is-working exists; .work-done is a static green dot. */
#sidebar .chat-row.is-working, #sidebar.has-plate .chat-row.is-working {
  background-image: linear-gradient(100deg, transparent 25%, rgba(52, 211, 153, .07) 50%, transparent 75%);
  background-size: 260% 100%; background-repeat: no-repeat; animation: w4-shimmer 2.6s linear infinite;
}
.chat-row.is-working .presence::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; box-sizing: border-box;
  border: 1.5px solid transparent; border-top-color: var(--rc-emerald, #34d399); border-right-color: rgba(52, 211, 153, .35);
  animation: w4-orbit 1.2s linear infinite, w4-halo 1.6s ease-in-out infinite;
}
.chat-row.work-done .presence::after {
  content: ""; position: absolute; right: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--rc-emerald, #34d399); box-shadow: 0 0 0 2px var(--panel), 0 0 6px rgba(52, 211, 153, .6);
  animation: w4-done 320ms cubic-bezier(.34, 1.56, .64, 1) 1 both;
}
@keyframes w4-shimmer { from { background-position: 130% 0 } to { background-position: -30% 0 } }
@keyframes w4-orbit { to { transform: rotate(360deg) } }
@keyframes w4-halo { 0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .35) } 50% { box-shadow: 0 0 0 3px rgba(52, 211, 153, 0) } }
@keyframes w4-done { from { opacity: 0; transform: scale(.4) } to { opacity: 1; transform: none } }

@media (max-width: 768px), (max-height: 500px) and (orientation: landscape) and (max-width: 960px) {
  .sidebar.has-plate { position: fixed }
  .shell.nav-collapsed .sidebar { transform: none; opacity: 1; transition: none }
  .shell.nav-collapsed #nav-toggle { display: inline-grid }
  .sidebar-restore, .sidebar-restore:not([hidden]) { display: none }
  html, body, .shell, .canvas { max-width: 100vw; overflow-x: hidden }
  .sidebar { max-width: calc(100vw - 12px) }
  .chat-row, .chat-row .row { min-height: 44px }
  .row-act { min-height: 40px; min-width: 40px }
  #nav-collapse.icon { min-width: 40px; min-height: 40px }
  .top #nav-toggle.icon, .top .top-actions button.icon { width: 40px; height: 40px; min-width: 40px; min-height: 40px }
  .top .chat-title { min-width: 0; overflow: hidden }
  .top .chat-title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
}
@media (prefers-reduced-motion: reduce) {
  .nav-plate, .nav-plate-bar, .sidebar, .shell { transition: none !important }
  .nav-plate::before, .sidebar-restore, .chat-row.work-done .presence::after { animation: none !important }
  #sidebar .chat-row.is-working, .chat-row.is-working .presence::after { animation: none !important }
  .chat-row.is-working .presence::after { box-shadow: 0 0 0 2px rgba(52, 211, 153, .35) }
}
/* @@W4-END */

/* @@W5-START (owned by web agent W5; put all new CSS for your task between these markers) */
/* «Let me glow» composer border beam. Desktop and web share the prefs (/api/glow → client.js
   HubGlow): data-glow-mode = smart | hover | always | static | off; colours/speed via CSS vars.
   ::before = sharp ring (coloured arc + white specular core), ::after = blurred bloom. The beam
   only animates while spinning; idle = no animation (0% GPU). window.hubGlowOrbit(el) still
   runs one clockwise orbit after a send. */
@property --glow-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg }
.hub-glow {
  position: relative;
  --glow-core: #ffffff; --glow-c1: #3b82f6; --glow-c2: #8b5cf6; --glow-c3: #ec4899;
  --glow-speed: 2.5s; --glow-bloom: 1; --glow-width: 1.5px; --glow-radius: 14px; --glow-on: 0;
}
form.composer.hub-glow { background: #141518; border: 1px solid #24262d; border-radius: var(--glow-radius) }
.hub-glow::before, .hub-glow::after {
  content: ""; position: absolute; inset: -1px; z-index: 2; pointer-events: none;
  border-radius: calc(var(--glow-radius) + 1px); padding: var(--glow-width);
  background: conic-gradient(from var(--glow-angle),
    transparent 0 70%, var(--glow-c1) 76%, var(--glow-c2) 84%, var(--glow-core) 89%, var(--glow-c3) 94%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: var(--glow-on); transition: opacity 250ms ease;
}
.hub-glow::after {
  padding: calc(var(--glow-width) + 3px * var(--glow-bloom)); inset: calc(-1px - 3px * var(--glow-bloom));
  border-radius: calc(var(--glow-radius) + 1px + 3px * var(--glow-bloom));
  filter: blur(calc(4px * var(--glow-bloom)));
  opacity: calc(var(--glow-on) * min(1, .55 * var(--glow-bloom)));
}
/* Spinning states per mode. */
form.hub-glow:not([data-glow-mode]):is(:hover, :focus-within, .recording, .working),
form.hub-glow[data-glow-mode="smart"]:is(:hover, :focus-within, .recording, .working),
form.hub-glow[data-glow-mode="hover"]:is(:hover, :focus-within),
form.hub-glow[data-glow-mode="always"],
.hub-glow.glow-spin { --glow-on: 1 }
form.hub-glow:not([data-glow-mode]):is(:hover, :focus-within, .recording, .working)::before,
form.hub-glow:not([data-glow-mode]):is(:hover, :focus-within, .recording, .working)::after,
form.hub-glow[data-glow-mode="smart"]:is(:hover, :focus-within, .recording, .working)::before,
form.hub-glow[data-glow-mode="smart"]:is(:hover, :focus-within, .recording, .working)::after,
form.hub-glow[data-glow-mode="hover"]:is(:hover, :focus-within)::before,
form.hub-glow[data-glow-mode="hover"]:is(:hover, :focus-within)::after,
form.hub-glow[data-glow-mode="always"]::before, form.hub-glow[data-glow-mode="always"]::after,
.hub-glow.glow-spin::before, .hub-glow.glow-spin::after { animation: hub-glow-spin var(--glow-speed) linear infinite }
/* Static top highlight (no animation). */
form.hub-glow[data-glow-mode="static"] { --glow-on: 1 }
form.hub-glow[data-glow-mode="static"]::before, form.hub-glow[data-glow-mode="static"]::after {
  background: linear-gradient(90deg, transparent 22%, var(--glow-c1) 34%, var(--glow-c2) 42%, var(--glow-core) 50%,
    var(--glow-c2) 58%, var(--glow-c1) 66%, transparent 78%) top / 100% var(--glow-width) no-repeat;
  -webkit-mask: none; mask: none; padding: 0;
}
form.hub-glow[data-glow-mode="off"]::before, form.hub-glow[data-glow-mode="off"]::after { content: none }
/* One orbit after a send (client.js hubGlowOrbit listens for hub-glow-orbit). */
.hub-glow.is-orbit { --glow-on: 1 }
.hub-glow.is-orbit::before, .hub-glow.is-orbit::after {
  animation: hub-glow-orbit var(--glow-speed) cubic-bezier(.65, 0, .35, 1) 1 forwards;
}
@keyframes hub-glow-spin { from { --glow-angle: 0deg } to { --glow-angle: 360deg } }
@keyframes hub-glow-orbit { 0% { --glow-angle: 0deg; opacity: 1 } 85% { opacity: 1 } 100% { --glow-angle: 360deg; opacity: 0 } }
@media (prefers-reduced-motion: reduce) {
  .hub-glow::before, .hub-glow::after { animation: none !important; transition: none }
  .hub-glow.is-orbit::before, .hub-glow.is-orbit::after { content: none }
}
/* Toolbar: left group with a 6px step, right group pinned right, one 30px axis. */
form.composer .compose-tools, form.composer .compose-footer { display: flex; align-items: center; gap: 6px; min-height: 30px; flex-wrap: wrap }
form.composer .compose-tools > *, form.composer .compose-footer > * { margin: 0 }
form.composer .compose-tools :is(button, .pop-wrap > button) { min-height: 30px; height: 30px }
form.composer .compose-footer .send { display: flex; align-items: center; gap: 6px; margin-left: auto }
form.composer .compose-footer .workspace-name + .auto-loop, form.composer .compose-footer > :first-child:not([hidden]) { margin-right: auto }
/* Settings → «Подсветка панели ввода». */
.glow-settings { display: grid; gap: 10px; max-width: 460px }
.glow-settings .glow-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px }
.glow-settings label { display: flex; align-items: center; gap: 8px; font-size: 13px }
.glow-settings input[type="range"] { flex: 1; min-width: 140px }
.glow-preset { width: 30px; height: 30px; border-radius: 50%; border: 1px solid #24262d; padding: 0; cursor: pointer;
  background: conic-gradient(var(--p1) 0 33%, var(--p2) 0 66%, var(--p3) 0) }
.glow-preset[aria-pressed="true"] { outline: 2px solid #e5e7eb; outline-offset: 1px }
.glow-preview { height: 44px; display: flex; align-items: center; padding: 0 14px; color: #8b8f98; font-size: 13px }
/* @@W5-END */
