/* Semantic status colors stay consistent across every Terminal view. */
:root{--complete:#16c784;--active:#8b3dff;--pending:#ff931f;--attention:#f04458;--green:#087f52;--amber:#a34805;--red:#d52c43}
.btn,.text-button,.quick-access a,.segmented button{display:inline-flex;align-items:center;justify-content:center;gap:8px;line-height:1.2}
.btn{min-height:44px;text-align:center;vertical-align:middle}
.btn .button-label{display:block;line-height:1.2}
.btn .icon,.text-button .icon{display:block;flex:0 0 20px;width:20px;height:20px}
.badge.count,.notification-count{display:grid;place-items:center;flex:none;min-width:22px;height:22px;padding:0 5px;border-radius:50px;line-height:1;font:600 12px/1 system-ui,sans-serif;letter-spacing:0;background:var(--attention);color:white;border:2px solid var(--surface,#fff);font-variant-numeric:tabular-nums}
.notification-count{position:absolute;inset-inline-end:0;top:0}
.badge.state-complete{background:#d8ffed;color:#006b43;border:1px solid #62e8ad}
.badge.state-pending{background:#fff0d8;color:#944000;border:1px solid #ffb561}
.badge.state-attention{background:#ffe3e8;color:#b81932;border:1px solid #ff8193}
.badge.state-active{position:relative;overflow:hidden;background:linear-gradient(110deg,#6d20d5,#9238ed);color:#fff;border:1px solid #9142e7}
.state-active::after,.gantt-bar.Active::after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(105deg,transparent 25%,#ffffff48 48%,transparent 70%);transform:translateX(-140%);animation:work-shimmer 5s ease-in-out infinite}
@keyframes work-shimmer{0%,62%{transform:translateX(-140%)}88%,100%{transform:translateX(140%)}}
.badge.state-neutral{color:var(--muted);background:var(--soft)}
.badge.status-badge{justify-content:center;min-height:27px;font-size:12px;line-height:1.2;padding:5px 9px}
.badge.green{background:#d8ffed;color:#006b43}.badge.amber{background:#fff0d8;color:#944000}.badge.red{background:#ffe3e8;color:#b81932}
.badge.state-active{color:white;background:linear-gradient(110deg,#6d20d5,#9238ed)}
.gantt-bar.Active{overflow:hidden;background:linear-gradient(110deg,#6d20d5,#9238ed);color:#fff}
.gantt-bar.Complete,.task-status-dot.Complete{background:var(--complete);color:#063e2a}
.gantt-bar.Pending,.task-status-dot.Pending{background:var(--pending);color:#512500}
.gantt-bar.Needs-you,.task-status-dot.Needs-you{background:var(--attention);color:#fff}
.task-status-dot.Active{background:var(--active)}
.board{grid-template-columns:repeat(5,minmax(220px,1fr))}
.board-column h3{display:flex;align-items:center;justify-content:space-between;gap:8px}
.pending-explanation{padding:12px 14px;border-inline-start:3px solid var(--pending);background:#fff5e8;color:#713608;margin-top:16px;font-size:14px;line-height:1.6}
.pending-explanation.needs-you{border-color:var(--attention);background:#ffe8ed;color:#a41931}.notice.red{border-color:#ff8193;background:#ffe8ed;color:#a41931}
.home-section-gap{height:20px}.decision-symbol{background:#ffe3e8;color:#d52c43}
.decision-symbol.pending{background:#fff0d8;color:#a34805}
.analytics-scope{border:1px solid var(--line);border-radius:14px;padding:18px;background:var(--surface);margin-bottom:16px}
.scope-tabs{display:flex;gap:6px;padding:4px;background:var(--soft);border-radius:10px;max-width:600px;margin-bottom:18px}
.scope-tabs button{flex:1;min-height:42px;padding:8px 12px;font-size:14px;border-radius:7px;line-height:1.3}
.scope-tabs button.active{background:var(--surface);color:var(--purple);box-shadow:0 2px 7px #20142f15;font-weight:600}
.scope-fields{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:16px;align-items:end}
.scope-fields label{display:grid;gap:7px;min-width:0;font-size:14px;color:var(--muted)}
.scope-fields select{min-width:0;width:100%}.scope-account-note{font-size:14px;line-height:1.6;color:var(--muted);align-self:center}
.scope-summary{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:14px;margin-top:16px;font-size:14px}
.scope-summary span{color:var(--muted)}.chart-legend{min-width:0;flex:1}.chart-legend button{min-height:42px}
.insight-kpis>a:nth-child(3){border-color:#ff8193}.insight-kpis>a:nth-child(3)>strong{color:#d52c43}
.activity-categories{display:flex;gap:8px;overflow-x:auto;padding-bottom:8px;margin-bottom:16px;scrollbar-width:thin}
.activity-categories button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid var(--line);background:var(--surface);border-radius:30px;min-height:44px;padding:9px 14px;white-space:nowrap;font-size:14px}
.activity-categories button.active{background:var(--purple);border-color:var(--purple);color:white}
.activity-categories b{font:600 12px/1 system-ui,sans-serif;min-width:19px;height:19px;display:grid;place-items:center;border-radius:50%;background:#8888881c}.activity-categories .icon{width:17px;height:17px}
.activity-filter-card{display:grid;gap:16px;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:20px}
.activity-filter-card label{display:grid;gap:7px;font-size:14px;color:var(--muted);min-width:0}
.activity-filter-grid{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:14px}.activity-filter-grid select{min-width:0;width:100%}
.activity-day{margin-top:26px}.activity-day>h2{font-size:14px;color:var(--muted);margin-bottom:12px;font-weight:500}
.activity-events{padding:0 20px}.activity-event{display:flex;align-items:flex-start;width:100%;gap:14px;text-align:start;padding:20px 0;border-bottom:1px solid var(--line);color:var(--ink)}
.activity-event:last-child{border-bottom:0}.activity-event:hover .event-body>strong{color:var(--purple)}
.event-symbol{display:grid;place-items:center;flex:none;width:38px;height:38px;border-radius:11px;background:var(--soft);color:var(--purple)}
.event-symbol.group-payments{background:#d8ffed;color:#087f52}.event-symbol.group-decisions{background:#ffe3e8;color:#d52c43}.event-symbol.group-agents{background:#f0e3ff;color:#7930dc}
.event-body{display:grid;gap:7px;flex:1;min-width:0}.event-topline{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;color:var(--muted)}
.event-body>strong{font-size:15px;line-height:1.5;overflow-wrap:anywhere}.event-context{font-size:13px;line-height:1.5;color:var(--muted)}
.event-amount{color:#d52c43;font-weight:600;font-size:14px}.activity-event>.icon{width:16px;margin-top:10px;color:var(--muted)}
.event-detail{max-width:800px;display:grid;gap:22px}.event-detail h2{font-size:24px;line-height:1.4}.event-detail p{line-height:1.7;overflow-wrap:anywhere}
.event-detail dl{display:grid;grid-template-columns:140px minmax(0,1fr);gap:14px;margin:0;font-size:14px}.event-detail dt{color:var(--muted)}.event-detail dd{margin:0;overflow-wrap:anywhere}
.primary-chat-head{display:flex;align-items:center;gap:14px}.primary-chat-head .portrait-box{flex:none}.primary-chat-head+form{display:grid;gap:18px}
/* Dark: a neutral or purple badge, a red notice, the decision tile, a danger button and the org chart's boxes take the dark surface (audit 5 Oct). A state's own tone, below, still outranks a caller's colour. */
:where([data-theme=dark]) .badge{background:#2c2b36;color:#c9c6d6}
[data-theme=dark] .badge.purple{background:#35244d;color:#d6baf8}
[data-theme=dark] .badge.state-complete,[data-theme=dark] .badge.green{background:#063e30;color:#61ecb3;border-color:#16825b}
[data-theme=dark] .badge.state-pending,[data-theme=dark] .badge.amber{background:#482b0e;color:#ffb45b;border-color:#a6671f}
[data-theme=dark] .badge.state-attention,[data-theme=dark] .badge.red{background:#501723;color:#ff9aaa;border-color:#a53c51}
[data-theme=dark] .pending-explanation{background:#38291a;color:#ffd098}
[data-theme=dark] .notice.red,[data-theme=dark] .pending-explanation.needs-you{background:#3a1820;color:#ffb3c0;border-color:#a53c51}
[data-theme=dark] .decision-symbol{background:#501723;color:#ff9aaa}[data-theme=dark] .decision-symbol.pending{background:#482b0e;color:#ffb45b}
[data-theme=dark] .btn.danger{color:#ff9aaa;border-color:#a53c51}
[data-theme=dark] .org-world .org-node:not(.identity){background:var(--surface)!important;border-color:var(--line)!important}[data-theme=dark] .org-node-type{color:#b9a3cc}
@media(max-width:900px){
 .bottom-nav.agent-dock{position:fixed;inset:auto auto max(12px,env(safe-area-inset-bottom)) 50%;transform:translateX(-50%);width:calc(100% - 28px);max-width:430px;min-height:64px;height:64px;padding:6px 9px;display:grid;grid-template-columns:1fr 1fr 1.18fr 1fr 1fr;align-items:center;gap:4px;border:1px solid var(--line);border-radius:30px;background:color-mix(in srgb,var(--surface,#fff) 94%,transparent);box-shadow:0 8px 35px #1d11301f;backdrop-filter:blur(20px);transition:height .22s,padding .22s,max-width .22s}
 .agent-dock>a,.agent-dock>button{display:grid;place-items:center;min-height:44px;width:100%;padding:0;gap:0;border-radius:50%;color:var(--muted);background:transparent;font-size:inherit}
 .agent-dock>a.active{color:var(--purple);background:var(--soft)}.agent-dock .icon{width:23px;height:23px}
 .agent-dock .primary-agent-button{height:66px;margin-top:-24px;align-self:center;z-index:1;background:none}
 .primary-agent-hex{width:66px;height:66px;display:grid;place-items:center;clip-path:polygon(25% 3%,75% 3%,100% 50%,75% 97%,25% 97%,0 50%);background:linear-gradient(145deg,#a363fa,#651cc6);filter:drop-shadow(0 5px 9px #7628c142)}
 .primary-agent-hex .portrait-box.dock-face{width:60px;height:60px;min-width:60px;max-width:60px;border:0;border-radius:0;box-shadow:none;background:transparent;overflow:visible;perspective:none;margin:0}
 .dock-face .work-dots{display:none}.dock-face .agent-stage{transform:none!important;animation:none!important}.dock-face [data-portrait]{width:100%;height:100%}.primary-agent-hex>.icon{color:white}
 .agent-dock.compact:not(:focus-within){height:54px;min-height:54px;max-width:350px;padding-block:3px}.agent-dock.compact .primary-agent-button{margin-top:-15px;height:59px}.agent-dock.compact .primary-agent-hex{width:59px;height:59px}
 .menu-open .agent-dock{visibility:hidden}.app-shell{padding-bottom:110px}
}
@media(max-width:700px){.scope-tabs{display:grid;grid-template-columns:1fr 1fr}.scope-tabs button{padding:8px}.scope-fields{grid-template-columns:1fr}.activity-filter-grid{grid-template-columns:1fr 1fr}.activity-filter-grid>label:first-child{grid-column:1/-1}.activity-filter-card{padding:16px}.activity-events{padding:0 14px}.activity-event{gap:10px}.event-symbol{width:32px;height:32px}.event-topline{font-size:12px}.event-body>strong{font-size:14px}.activity-filter-card .row{flex-wrap:wrap}.ring-breakdown{flex-direction:column}.metric-ring{align-self:center}.chart-legend{width:100%}.chart-legend>button{font-size:14px}.event-detail dl{grid-template-columns:1fr;gap:7px}.event-detail dd{margin-bottom:10px}.event-detail h2{font-size:21px}.insight-task>.badge{margin-inline-start:37px}.page-heading>.actions{align-items:center}}
@media(prefers-reduced-motion:reduce){.state-active::after,.gantt-bar.Active::after{animation:none;display:none}.agent-dock{transition:none!important}}
.reduced-motion .state-active::after,.reduced-motion .gantt-bar.Active::after{animation:none;display:none}.reduced-motion .agent-dock{transition:none}
/* Phone: Activity's and Records' one action sits beside the title, the subtitle under both; the category chips wrap instead of scrolling; a tab strip wraps onto a second line instead of cutting a word at the edge; "Add document" stays beside its heading. */
@media(max-width:700px){.page-heading:has(>.actions a[href="#/records"]),.page-heading:has(>.actions [data-action=export-records]){flex-wrap:wrap;align-items:center;row-gap:4px}.page-heading:has(>.actions a[href="#/records"])>div:first-child,.page-heading:has(>.actions [data-action=export-records])>div:first-child{display:contents}.page-heading:has(>.actions a[href="#/records"]) h1,.page-heading:has(>.actions [data-action=export-records]) h1{flex:1 1 0;min-width:0}.page-heading:has(>.actions a[href="#/records"]) .muted,.page-heading:has(>.actions [data-action=export-records]) .muted{order:2;flex:1 0 100%}.activity-categories{flex-wrap:wrap;overflow-x:visible}.card-head:has([data-action=add-document]){flex-wrap:nowrap}.card-head:has([data-action=add-document]) h2{min-width:0}.card-head:has([data-action=add-document]) .btn{flex-shrink:0}}
/* Inbox (audit 5 Oct): an Updates row opens its record; on a phone the answer bar sits in the page under the card, never over it, the face and the bottom bar clear of it; on a wide screen the page ends below the face. */
a.activity-item{color:inherit;text-decoration:none}a.activity-item:hover p{color:var(--purple)}
@media(max-width:700px){.approval-actions{position:static;box-shadow:none}.balance-card .actions{flex-wrap:nowrap;gap:8px}.balance-card .actions>.btn{padding-inline-start:12px;padding-inline-end:12px}}
@media(min-width:701px){.content:has(.ask-detail){padding-bottom:96px}}

/* The chat's header carries the agent's one-word status (the Founder, 6 October 2026), small, beside the role. */
.chat-head-status .status-badge{padding:1px 6px;font-size:.6875rem;vertical-align:1px}
/* QA, 7 October 2026: the status line of the chat's header is one row, the small pill, Working, then the role and the platform, which alone give way. */
.chat-panel-head small.chat-head-line{display:flex;flex-wrap:wrap;align-items:center;gap:0 6px;min-width:0;max-height:22px;overflow:hidden}
.chat-head-line .chat-head-status{display:inline-flex;align-items:center;gap:6px;flex:none}
.chat-head-line .chat-head-status .badge.status-badge[class*=state-]{gap:4px;min-height:0;height:20px;padding:1px 7px 1px 5px;font-size:11px;line-height:16px}
.chat-head-line .chat-head-status .agent-activity{font-size:11px}
/* The role gives way with an ellipsis; with less room than a short word it moves to a second line, which is not shown, rather than show as one letter. */
.chat-head-line .chat-head-role{flex:1 1 0;min-width:4em;line-height:22px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* Working, beside the connection pill (the Founder, 6 October 2026): plain words and the portrait's own three moving dots, never a pill. */
.agent-activity{display:inline-flex;align-items:center;gap:4px;font-size:.75rem;font-weight:600;color:var(--purple);white-space:nowrap}
.agent-activity .work-dots{position:static;display:inline-flex;gap:3px;background:none;padding:0;align-items:center}
/* In the grid the connection pill sits at the card's foot; Working stands just above it, out of the flow, so every card's pill is in the same place. */
/* QA, 7 October 2026: Working stands beside the face, at the card's top right, never over the role or against the pill. */
[data-collection-items=agents][data-view=grid]>.agent-card{position:relative}
[data-collection-items=agents][data-view=grid] .agent-compact-meta>.agent-activity{position:absolute;inset-inline-start:auto;inset-inline-end:12px;top:28px;bottom:auto;font-size:11px;line-height:16px}
/* QA, 7 October 2026: in the list, Working stands on the name's line at the right, so every row's pill sits in one column. */
[data-collection-items=agents][data-view=list]>.agent-card{position:relative}
[data-collection-items=agents][data-view=list] .agent-compact-meta>.agent-activity{position:absolute;inset-inline-end:35px;top:17px;font-size:11px;line-height:16px}
[data-collection-items=agents][data-view=list] .agent-compact-copy:has(.agent-activity)>.agent-compact-name{padding-inline-end:84px}
