/* Shared visual theme: white surfaces, charcoal text and quiet grey controls.
   Loaded last so legacy pages and React islands use the same visual language. */
:root{
 --portal-canvas:#ffffff;
 --portal-surface:#fff;
 --portal-chrome:#fafafa;
 --portal-hover:#f3f3f3;
 --portal-selection:#ededed;
 --portal-ink:#242424;
 --portal-secondary:#626262;
 --portal-tertiary:#757575;
 --portal-accent:#292929;
 --portal-accent-hover:#111111;
 --portal-border:#e7e7e7;
 --portal-focus:#8c8c8c;
 --portal-action:#0f6cbd;
 --portal-action-hover:#0b5a9e;
 --portal-action-soft:#eaf3fb;
 --portal-success:#237a57;
 --green:var(--portal-accent);
 --muted:var(--portal-secondary);
 --line:var(--portal-border);
 font-family:"Segoe UI Variable","Segoe UI","Microsoft YaHei",sans-serif;
 color:var(--portal-ink);
 background:var(--portal-canvas);
}
body,.shell,.shell-content{color:var(--portal-ink);background:var(--portal-canvas)}
a{color:var(--portal-accent)}
button{color:var(--portal-ink);background:var(--portal-surface);border-color:var(--portal-border);font-weight:500;box-shadow:none}
button:hover:not(:disabled){background:var(--portal-hover);border-color:#d5d5d5}
button.primary{background:var(--portal-action);border-color:var(--portal-action);color:#fff}
button.primary:hover:not(:disabled){background:var(--portal-action-hover);border-color:var(--portal-action-hover)}
button.danger{color:#b13e48}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline-color:var(--portal-focus)}
input,select,textarea{background:var(--portal-surface);color:var(--portal-ink);border-color:#d9d9d9;border-radius:8px}
input::placeholder,textarea::placeholder{color:var(--portal-tertiary)}
input[type=checkbox],input[type=radio]{accent-color:var(--portal-action)}
input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--portal-focus);outline-offset:2px}
h1,h2,h3,.value{color:var(--portal-ink)}
h1,h2,h3{font-weight:600}
.micro,.pagefoot,.loginbox footer{color:var(--portal-tertiary)}
.topbar{background:var(--portal-canvas);border-bottom-color:var(--portal-border);color:var(--portal-secondary)}
.topbar strong{color:var(--portal-secondary)}
.pagehead h1{letter-spacing:-.4px}
.pagehead p,.empty,.work-empty{color:var(--portal-secondary)}
.card{border-color:var(--portal-border);border-radius:16px;background:var(--portal-surface);box-shadow:0 2px 8px #00000003}
.cardhead h2{font-weight:600}
.notice{color:#505050;background:#f6f6f6;border-color:#e6e6e6}
.notice.warning{color:#805f22;background:#fff8e9;border-color:#efdfb8}
.notice.error{color:#a33e48;background:#fff1f2;border-color:#f0d2d7}
.emptyicon{color:#a2a2a2}
.tag{color:var(--portal-success);background:#edf6f0;font-weight:400}
.tag:not(.warning):not(.error) .dot{background:var(--portal-success)}
.tag.warning{color:#856021;background:#fff4dd}
.tag.error{color:#a33e48;background:#fceef0}
.step{border-bottom-color:var(--portal-border)}
.stepnum{border-color:#dddddd;color:var(--portal-tertiary)}
.step.done .stepnum{background:#edf6f0;border-color:#edf6f0;color:var(--portal-success)}
.work-row,.artifact-tools{border-color:var(--portal-border)}
a.work-row:hover{background:#fafafa}
.artifact-tile{background:var(--portal-surface);border-color:var(--portal-border);border-radius:14px;box-shadow:0 2px 8px #00000003}
.artifact-tile:hover{background:#fafafa;border-color:#cdcdcd}
.artifact-tile-top>span{color:var(--portal-action)}
.work-dialog{color:var(--portal-ink);background:var(--portal-surface);border-color:var(--portal-border);box-shadow:0 20px 70px #00000026}
th,td{border-color:var(--portal-border)}
th{color:var(--portal-secondary)}

/* Quiet navigation, with a grey surface marking the current location. */
.sidebar{background:var(--portal-chrome);border-right-color:#e8e8e8;color:var(--portal-ink)}
.sidebar .brand{color:var(--portal-ink)}
.sidebar .brandmark{background:#176b59;color:#fff;box-shadow:none}
.sidebar .sidebar-link>.portal-nav-icon{color:#6f8196}
.sidebar .sidebar-link.active>.portal-nav-icon{color:var(--portal-action)}
.sidebar .sidebar-link,.sidebar .chat-conversation-row,.sidebar .chat-conversation-row>a{color:#4d4d4d}
.sidebar .sidebar-link:hover,.sidebar .chat-conversation-row:hover,.sidebar .sidebar-user:hover,.sidebar .sidebar-collapse:hover{background:var(--portal-hover);border-color:transparent}
.sidebar .sidebar-link.active,.sidebar .nav-parent.active,.sidebar .chat-conversation-row.selected{background:var(--portal-selection);color:#242424;font-weight:500}
.sidebar .avatar{background:#e9f0f6;color:#58738b}
.sidebar-user,.sidebar .sidebar-user-name strong{color:var(--portal-ink)}
.sidebar-user[aria-expanded=true]{background:var(--portal-hover)}
.sidebar .sidebottom{border-top-color:var(--portal-border)}
.sidebar .sidebar-user-menu,.sidebar.is-collapsed .nav-flyout,.sidebar.is-collapsed.search-open .sidebar-search-field{background:var(--portal-surface);border-color:var(--portal-border);box-shadow:0 12px 36px #00000017}
.sidebar .sidebar-menu-heading,.sidebar .chat-group-label,.sidebar .chat-list-empty{color:var(--portal-tertiary)}
.sidebar .sidebar-menu-divider{background:var(--portal-border)}
.sidebar .sidebar-search-field .chat-search:hover,.sidebar .sidebar-search-field .chat-search:focus-within{background:var(--portal-hover)}
.sidebar .sidebar-search-field .chat-search input{color:var(--portal-ink);background:transparent}
.sidebar .sidebar-search-field .chat-search input::placeholder{color:var(--portal-secondary)}
.sidebar :focus-visible{outline-color:var(--portal-focus)}
.sidebar-resize>span{background:#d1d1d1}
.m365-launcher-trigger:hover,.m365-launcher-trigger[aria-expanded=true]{color:var(--portal-accent);background:var(--portal-selection)}
.m365-apps-panel{border-color:var(--portal-border);box-shadow:0 16px 48px #0000001c,0 2px 8px #00000008}
.sidebar .m365-app-tile:hover{background:#f4f4f4}
.m365-apps-footer{border-top-color:var(--portal-border)}
.m365-apps-footer a,.m365-apps-footer a:hover{color:var(--portal-accent)}

/* One consistent canvas and input surface for overview and conversation. */
.is-overview-page,.is-overview-page .overview-toolbar,.is-overview-page .overview-workspace,.chat-app,.chat-composer-wrap{background:var(--portal-canvas)}
.is-overview-page .overview-toolbar strong,.overview-workspace #overview-title,.chat-welcome h2{color:var(--portal-ink);font-weight:500}
.overview-workspace .overview-input,.chat-composer{background:var(--portal-surface);border-color:#dedede;border-radius:20px;box-shadow:0 4px 18px #00000008}
.overview-input:focus-within,.overview-workspace .overview-input:focus-within,.chat-composer:focus-within{border-color:#aaaaaa;box-shadow:0 0 0 3px #2929290b,0 4px 18px #00000008}
.overview-input textarea,.chat-composer textarea{color:var(--portal-ink);background:transparent}
.overview-input textarea:focus-visible,.chat-composer textarea:focus-visible{outline:0;box-shadow:none}
.overview-input textarea::placeholder,.chat-composer textarea::placeholder{color:var(--portal-tertiary)}
.overview-guidance-heading h2,.overview-guide-controls,.overview-guidance-restore button,.overview-suggestion-description,.overview-summary,.overview-summary a,.overview-reveal-hint{color:var(--portal-secondary)}
.overview-workspace .overview-suggestion{color:#505050}
.overview-workspace .overview-suggestion:hover,.overview-guide-controls button:hover,.overview-guidance-restore button:hover{background:#f4f4f4}
.overview-suggestion>.overview-icon:first-child{filter:invert(36%) sepia(25%) saturate(1120%) hue-rotate(172deg) brightness(90%) contrast(87%);opacity:.8}
.overview-workspace .overview-recent-trigger{color:var(--portal-secondary)}
.overview-scene[data-stage=hint] .overview-recent-trigger{color:var(--portal-ink)}
.overview-recent-trigger::before{background:var(--portal-border)}
.overview-section-heading h3,.overview-work-main strong{color:var(--portal-ink)}
.overview-section-heading a,.overview-calendar button{color:var(--portal-accent)}
.overview-recent-columns>section,.overview-work-row,.overview-calendar{border-color:var(--portal-border)}
.overview-work-row:hover{background:#f7f7f7}
.chat-composer .chat-send,.overview-input .overview-send,.chat-stop{color:var(--portal-accent);background:var(--portal-selection)}
.chat-composer .chat-send:hover:not(:disabled),.overview-input .overview-send:hover:not(:disabled),.chat-stop:hover:not(:disabled){background:#dddddd}
.chat-composer .chat-send:disabled,.overview-input .overview-send:disabled{background:#f3f3f3;opacity:.55}
.chat-composer-bottom>small,.chat-ai-notice,.chat-tool-status,.chat-tool-step small{color:var(--portal-tertiary)}
.chat-composer-bottom>button:first-child{color:var(--portal-secondary)}
.chat-reasoning-trigger,.chat-reasoning-mode,.chat-composer .chat-reasoning-trigger{color:var(--portal-secondary);background:#f3f3f3}
.chat-menu,.chat-reasoning-popover,.chat-attach-menu{background:var(--portal-surface);border-color:var(--portal-border);box-shadow:0 8px 28px #0000001a}
.chat-menu-item,.chat-reasoning-popover{color:var(--portal-ink)}
.chat-menu-item[data-highlighted],.sidebar .chat-menu-item[data-state=checked],.chat-reasoning-popover button[aria-pressed=true]{background:var(--portal-selection);color:var(--portal-accent)}
.chat-menu-danger{color:#b13e48}
.chat-menu-separator{background:var(--portal-border)}
.chat-message-actions button,.chat-message-actions a{color:var(--portal-tertiary)}
.chat-message-actions button:hover:not(:disabled),.chat-message-actions a:hover{background:var(--portal-hover);color:var(--portal-accent)}
.chat-tool-step,.chat-tool-summary{background:#f7f7f7;border-color:var(--portal-border);color:var(--portal-secondary)}
.chat-tool-step.is-running,.chat-tool-status.is-running{color:var(--portal-action)}
.chat-tool-step.is-failed{color:#a33e48;background:#fff1f2}
.chat-tool-step.is-unknown{color:#856021}
.chat-attachment,.chat-user .chat-attachment{background:#f7f7f7;border-color:var(--portal-border);color:var(--portal-ink)}
.chat-attachment.has-error{background:#fff1f2;border-color:#efd4d8}
.chat-user{background:#f1f1f1;color:var(--portal-ink)}
.attachment-image-trigger{background:#f2f2f2;border-color:var(--portal-border);color:var(--portal-secondary)}
.attachment-image-trigger:hover{background:var(--portal-selection)}

/* Reading surfaces share typography and neutral evidence containers. */
.chat-markdown,.artifact-markdown,.response-ui{color:var(--portal-ink)}
.chat-markdown pre,.artifact-markdown pre{background:#fff;border-color:var(--portal-border);border-radius:16px}
.chat-markdown code{background:#f4f4f4}
.chat-markdown pre code{background:transparent}
.chat-markdown th,.artifact-markdown th,.response-table-scroll th{background:#f7f7f7;color:#565656}
.response-table-scroll caption{background:#fafafa;color:var(--portal-ink)}
.chat-markdown blockquote,.artifact-markdown blockquote{background:#fafafa;border-left-color:#cccccc;color:var(--portal-secondary)}
.response-summary{border-left-color:#b8b8b8}
.response-sources,.response-source-count,.response-sources small,.response-pending,.response-item-list>h3 small{color:var(--portal-secondary)}
.response-item>summary{color:#454545}
.response-item>summary::marker{color:#878787}
.response-status{background:#f7f7f7;border-color:var(--portal-border);color:var(--portal-secondary)}
.response-status.is-empty{color:var(--portal-secondary)}
.response-status.is-warning{background:#fff8e9;border-color:#efdfb8;color:#805f22}
.response-status.is-error{background:#fff1f2;border-color:#f0d2d7;color:#a33e48}

/* Connections and preferences are part of the same product. */
.m365-connector,.m365-product h2,.m365-title h1{color:var(--portal-ink)}
.m365-title p,.m365-product p,.m365-tenant small{color:var(--portal-secondary)}
.m365-account{background:#f7f7f7;border-color:#e3e3e3}
.m365-account strong,.m365-tenant strong{color:#4f4f4f}
.m365-account button{background:#fff;border-color:#d7d7d7;color:var(--portal-accent)}
.m365-tenant,.m365-counts span+span{border-color:#dddddd}
.m365-table,.m365-row{border-color:var(--portal-border)}
.m365-levels{border-color:#dddddd;background:#f7f7f7}
.m365-levels button{background:transparent;color:var(--portal-secondary)}
.m365-levels button[aria-pressed=true],.m365-levels button.selected,.m365-levels .selected{background:var(--portal-selection);color:var(--portal-accent)}
.m365-levels label.selected{background:var(--portal-action-soft);color:var(--portal-ink);font-weight:500}
.m365-levels input{accent-color:var(--portal-action)}
.m365-levels label:focus-within{outline-color:var(--portal-focus)}
.m365-footer button.primary{background:var(--portal-action);border-color:var(--portal-action)}
.m365-footer button.primary:hover:not(:disabled){background:var(--portal-action-hover);border-color:var(--portal-action-hover)}
.m365-auto-send-switch{background:#8794a3}
.m365-auto-send-switch[aria-checked=true]{background:var(--portal-action)}
.m365-auto-send-switch:focus-visible{outline-color:#77a9d5}
.m365-counts{color:var(--portal-success)}
.m365-indicator.connected{background:var(--portal-success)}
.m365-badge.authorized{color:var(--portal-success);background:#edf6f0}
.m365-badge.authorized>span{background:var(--portal-success)}
.chat-running{background:var(--portal-action)}
.agent-settings-badge{background:var(--portal-action-soft);border-color:#dbe8f5;color:var(--portal-action)}
.agent-setting-icon{background:#edf3f9;color:#617f9e}
.agent-setting-copy p,.agent-settings-actions p{color:var(--portal-secondary)}
.agent-switch span{background:#8794a3}
.agent-switch input:checked+span{background:var(--portal-action)}
.agent-switch input:focus-visible+span{outline-color:#77a9d5}
.memory-meta,.memory-row details{color:var(--portal-secondary)}
.loginhero{background:#303030;color:#fafafa}
.loginhero h1{color:#fff}
.loginhero p,.loginhero .eyebrow{color:#dddddd}
.loginhero .brandmark{background:#176b59;color:#fff}
.loginhero:after{border-color:#b4b4b425;box-shadow:0 0 0 70px #b4b4b40b,0 0 0 140px #b4b4b408}
@media(prefers-reduced-motion:reduce){.card,.artifact-tile{transition:none}}

.tag[data-status=cancelled],.tag[data-status=paused]{color:#646464;background:#f1f1f1}
.tag[data-status=cancelled] .dot,.tag[data-status=paused] .dot{background:#646464!important}
.profile-settings{max-width:900px}
.profile-settings .profile-head{gap:20px;margin-bottom:28px}
.profile-settings .profile-avatar{position:relative;display:grid;place-items:center;width:80px;height:80px;flex:none;border-radius:50%;background:#edf2f8;color:#355c82;font-size:24px;font-weight:500;overflow:hidden}
.profile-settings .profile-avatar-photo{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.has-photo>[data-avatar-initials],.has-photo>svg{visibility:hidden}
[data-avatar-initials]{font-size:inherit;line-height:1}
.profile-photo-refresh{border:0;background:none;padding:4px 0;margin:0 14px 0 0;color:#23649c;font-size:13px}
.profile-photo-note{font-size:12px;color:#788594}
.profile-preference-row{display:flex;justify-content:space-between;align-items:center;gap:24px;padding:22px 0;border-top:1px solid #e4e8ed;border-bottom:1px solid #e4e8ed}
.profile-preference-row label{font-size:15px;font-weight:600}
.profile-preference-row p{font-size:13px;color:#687585;margin:7px 0 0;line-height:1.7}
.profile-preference-row select{width:210px;min-width:170px;margin:0;flex:none}
.profile-preference-actions{display:flex;align-items:center;gap:16px;margin-top:18px}
.profile-preference-actions button{margin:0}
.profile-preference-actions [role=alert]{margin:0;color:#a03e24;font-size:13px}
.profile-account-details{margin-top:26px}
.profile-account-details summary{font-size:13px;color:#66788b;cursor:pointer}
.profile-account-details .details{margin-top:20px}
@media(max-width:640px){.profile-preference-row{align-items:stretch;flex-direction:column;gap:14px}.profile-preference-row select{width:100%}.profile-settings .profile-head{align-items:flex-start;gap:14px}.profile-photo-note{display:block;margin-top:6px}.profile-settings .profile-avatar{width:64px;height:64px;font-size:21px}}
