/* The Five: one conversation surface and one vertical scroll owner. */
.five-chat{--chat-line:#30404d;--chat-bg:#101a23;--chat-text:#f1f5f7;--chat-muted:#b9c6cf;--chat-cyan:#a3e8ed;box-sizing:border-box;width:min(820px,calc(100% - 32px));max-height:calc(100dvh - 40px);padding:0;border:1px solid var(--chat-line);border-radius:12px;background:var(--chat-bg);color:var(--chat-text);overflow:auto;scroll-padding-top:112px;font:16px/1.65 Inter,system-ui,sans-serif;box-shadow:0 24px 80px #0008}.five-chat::backdrop{background:#02070bd9;backdrop-filter:blur(6px)}
.five-chat *{box-sizing:border-box}.five-chat [hidden]{display:none!important}.five-chat button,.five-chat textarea,.five-chat select{font:inherit}.five-chat button{cursor:pointer;color:inherit}.five-chat button:disabled{opacity:.55;cursor:default}.five-chat :is(button,textarea,select,summary):focus-visible{outline:2px solid var(--chat-cyan);outline-offset:3px}
.five-chat .chat-heading{position:sticky;top:0;z-index:4;display:flex;justify-content:space-between;gap:24px;padding:24px 28px 20px;background:var(--chat-bg);border-bottom:1px solid var(--chat-line);margin:0}.chat-identity{display:flex;gap:16px;align-items:center}.chat-identity img{width:56px;height:56px;border-radius:50%;object-fit:cover;border:1px solid var(--chat-accent)}.five-chat .chat-kicker{margin:0 0 4px;font:11px/1.4 Mono,'JetBrains Mono',monospace;letter-spacing:.07em;color:var(--chat-muted)}.five-chat h2{font:700 32px/1.05 Rajdhani,system-ui,sans-serif;letter-spacing:0;margin:0;color:var(--chat-text)}.five-chat #fiveRole{font-size:12px;line-height:1.4;color:var(--chat-muted);margin:5px 0 0}.chat-icon{display:inline-flex;align-items:center;justify-content:center;align-self:start;min-width:44px;min-height:44px;border:1px solid var(--chat-line);border-radius:6px;background:transparent;font-size:18px}
.chat-body{padding:24px 28px 28px}.chat-voices{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin-bottom:24px}.chat-voices button{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px;min-height:52px;padding:8px 6px;border:1px solid transparent;border-radius:6px;background:transparent;font-size:13px}.chat-voices button img{width:32px;height:32px;object-fit:cover;border-radius:50%;filter:saturate(.7)}.chat-voices button[aria-pressed=true]{border-color:var(--mind);background:#ffffff08}.chat-voices button:hover:not(:disabled){background:#ffffff0a}.chat-voices button[aria-pressed=true] img{filter:none}
.chat-context{display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px 16px;align-items:center;margin-bottom:18px}.chat-context label{font-size:13px;color:var(--chat-muted)}.chat-context select{width:100%;min-height:44px;padding:10px 32px 10px 12px;border:1px solid var(--chat-line);border-radius:6px;background:#080f16;color:var(--chat-text);font-size:14px;text-overflow:ellipsis}.chat-context #nexusReset{grid-column:2;justify-self:end;font-size:12px;min-height:44px;padding:5px 0}.five-chat .chat-focus{font-size:15px;color:var(--chat-text);line-height:1.65;margin:0 0 10px}.chat-interpretation{font-size:12px;line-height:1.6;color:var(--chat-muted);margin:0 0 24px;max-width:65ch}
.chat-history{border-top:1px solid var(--chat-line);margin:24px 0}.chat-message{padding:22px 0;border-bottom:1px solid var(--chat-line);outline-offset:4px}.chat-message.user{margin-left:36px}.chat-message.assistant{margin-right:36px}.chat-message-speaker{font-size:12px;line-height:1.5;color:var(--chat-muted);font-weight:600;margin:0 0 8px}.chat-message.assistant .chat-message-speaker{color:var(--chat-cyan)}.chat-message-content{font-size:16px;line-height:1.75;white-space:pre-wrap;overflow-wrap:anywhere;margin:0}.chat-message.user .chat-message-content{color:var(--chat-muted)}.chat-sources{font-size:12px;color:var(--chat-muted);margin-top:12px}.chat-sources summary{cursor:pointer;min-height:44px;padding:5px 0}.chat-sources p{margin:6px 0}
.chat-pending{display:flex;gap:16px;align-items:center;justify-content:space-between;border-left:2px solid var(--chat-cyan);padding:8px 0 8px 16px;margin:20px 0}.chat-pending p{margin:0;font-size:13px;color:var(--chat-muted)}.chat-pending button{flex:none}.chat-failure{border:1px solid #71503f;background:#211b18;border-radius:8px;padding:18px;margin:20px 0}.chat-failure h3{font-size:16px;margin:0 0 8px}.chat-failure p{font-size:14px;margin:8px 0;color:#e0cec2}.chat-failure blockquote{padding:12px 0 12px 16px;border-left:2px solid #a67e64;margin:16px 0;font-size:14px;overflow-wrap:anywhere;white-space:pre-wrap}.chat-failure .chat-fineprint{font-size:12px}.chat-failure .chat-secondary{margin-right:12px}
.chat-primary,.chat-secondary,.chat-text-button{min-height:44px;border-radius:6px;padding:10px 16px;font-size:14px;font-weight:500}.chat-primary{background:var(--chat-cyan);color:#081518!important;border:1px solid var(--chat-cyan)}.chat-primary:hover:not(:disabled){background:#cbf7f7}.chat-secondary{border:1px solid var(--chat-line);background:transparent}.chat-text-button{border:0;background:transparent;padding-inline:0;color:var(--chat-muted)!important}.chat-text-button:hover:not(:disabled),.chat-secondary:hover:not(:disabled){color:var(--chat-cyan)!important}.chat-failure .chat-secondary{border-color:#8a6753}.chat-suggestions{display:flex;flex-wrap:wrap;gap:8px;margin:24px 0}.chat-suggestions button{min-height:44px;max-width:100%;padding:10px 14px;border:1px solid var(--chat-line);border-radius:6px;background:transparent;font-size:13px;text-align:left;line-height:1.5}.chat-suggestions button:hover:not(:disabled){border-color:#68818b;color:var(--chat-cyan)}
.five-chat #nexusForm{margin:24px 0 18px}.five-chat #nexusForm>label{display:block;margin-bottom:8px;font-size:14px;font-weight:600}.five-chat textarea{display:block;resize:vertical;width:100%;min-height:100px;max-height:320px;padding:14px 16px;border:1px solid #516470;border-radius:8px;background:#080f16;color:var(--chat-text);font-size:16px;line-height:1.6}.five-chat textarea::placeholder{color:#9aacb7}.five-chat textarea[aria-invalid=true]{border-color:#e9a584}.chat-form-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:12px}.chat-form-footer p{font-size:11px;color:var(--chat-muted);margin:0}.chat-form-footer button{flex:none}.chat-validation{padding:10px 0;font-size:13px;color:#ffbea0;margin:0}.chat-details{border-top:1px solid var(--chat-line);padding-top:12px;font-size:12px;color:var(--chat-muted)}.chat-details summary{cursor:pointer;min-height:44px;padding:10px 0}.chat-details p{margin:6px 0;overflow-wrap:anywhere}.chat-details button{font-size:12px}.chat-sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
@media(max-width:600px){.five-chat{width:calc(100% - 20px);max-height:calc(100dvh - 20px);border-radius:10px;scroll-padding-top:110px}.five-chat .chat-heading{padding:18px 18px 16px;gap:16px}.chat-body{padding:18px}.chat-identity{gap:12px}.chat-identity img{width:48px;height:48px}.five-chat h2{font-size:28px}.chat-voices{gap:4px;margin-bottom:18px}.chat-voices button{flex-direction:column;padding:8px 3px;font-size:12px;gap:6px}.chat-voices button img{width:32px;height:32px}.chat-context{grid-template-columns:1fr;gap:8px}.chat-context #nexusReset{grid-column:1;min-height:44px}.chat-context select{font-size:14px}.chat-message.user{margin-left:18px}.chat-message.assistant{margin-right:0}.chat-message-content{font-size:16px}.chat-pending{display:block}.chat-pending button{margin-top:8px}.chat-form-footer{flex-wrap:wrap}.chat-form-footer button{margin-left:auto}.chat-failure{padding:14px}.chat-interpretation{font-size:12px}.chat-suggestions{gap:8px}.chat-suggestions button{width:100%}}
@media(prefers-reduced-motion:reduce){.five-chat,.five-chat *{scroll-behavior:auto;animation:none!important;transition:none!important}}

/* Quiet connection and streaming states; no token-by-token live-region announcements. */
.five-chat .chat-connection{font-size:11px;line-height:1.45;margin:6px 0 0;color:var(--chat-muted)}.chat-connection[data-state=online]{color:var(--chat-cyan)}.chat-connection[data-state=offline]{color:#e7b999}.chat-message.streaming{border-left:2px solid var(--chat-cyan);padding-left:16px}.five-chat{scroll-padding-top:145px}
