/* Customer-facing AEGIS page. Owner AEGIS console remains a separate Access-protected route. */
:root{font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color-scheme:dark;background:#090a0c;color:#f3f4f6}
*{box-sizing:border-box}
body{margin:0;min-height:100vh;background:#090a0c;color:#f3f4f6}
a{color:inherit}
.skip-link{position:absolute;left:-9999px;top:0;z-index:15000;padding:12px;background:#fff;color:#101214}
.skip-link:focus{left:12px;top:12px}
.site-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px max(16px,calc((100vw - 1080px)/2));border-bottom:1px solid #383d43;background:#101214}
.site-brand{display:inline-flex;align-items:center;min-height:46px}
.site-brand img{display:block;max-width:40vw;width:135px;height:auto;object-fit:contain}
.site-nav{display:flex;gap:16px;flex-wrap:wrap;align-items:center}
.site-nav a{min-height:44px;display:inline-flex;align-items:center;text-decoration:none}
main{max-width:1080px;padding:28px 20px 56px;margin:auto}
main>section{border:1px solid #45494f;border-radius:17px;padding:clamp(18px,3.5vw,32px);background:#171717;margin:20px 0}
.eyebrow{font:700 11px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:.16em;color:#cdd0d3}
h1{font-size:clamp(2rem,5.5vw,3.6rem);line-height:1.09;letter-spacing:-.04em;max-width:760px;margin:.4em 0}
h2{font-size:clamp(1.25rem,3.2vw,1.7rem);margin:.25em 0}
h3{font-size:1.06rem;margin:.2em 0 .65em}
p{line-height:1.65}
.aegis-hero>p:not(.eyebrow){max-width:750px;color:#c9cbd0}
.aegis-links{display:flex;flex-wrap:wrap;gap:10px;margin-top:24px}
.aegis-links a{display:inline-flex;align-items:center;justify-content:center;border:1px solid #777c83;border-radius:10px;padding:10px 15px;min-height:44px;text-decoration:none;font-weight:650}
.aegis-links a:hover{background:#292d31}
.aegis-chat-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.aegis-tier{display:inline-block;border:1px solid #80858b;border-radius:999px;padding:8px 12px;font-size:.8rem}
.aegis-status{border:1px solid #575d65;border-radius:12px;background:#23272c;padding:12px 15px;margin:14px 0 20px;color:#eff1f3}
.aegis-chat-form{display:grid;gap:12px}
.aegis-chat-form label{font-weight:750}
.aegis-chat-form textarea{width:100%;min-height:125px;resize:vertical;border-radius:11px;padding:14px;font:inherit;line-height:1.5;background:#111417;border:1px solid #7c8188;color:#f5f7f8}
.aegis-chat-actions{display:flex;flex-wrap:wrap;gap:12px}
.aegis-chat-actions button{min-height:46px;border-radius:10px;border:1px solid #858a92;background:#30343a;color:#fff;padding:10px 18px;font-family:inherit;font-size:14px;font-weight:700;line-height:1.4;cursor:pointer}
.aegis-chat-actions button[type=submit]{background:#e9ebed;color:#131517}
.aegis-chat-actions button:disabled{cursor:not-allowed;opacity:.5}
.aegis-answer-shell{margin-top:26px;padding:20px;border:1px solid #4b5058;border-radius:13px;background:#101214}
.aegis-chat-answer{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.65;min-height:65px}
.aegis-empty,.aegis-disclaimer{color:#bcbfc5}
.aegis-disclaimer{font-size:.89rem}
.aegis-capability-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:18px}
.aegis-capability-grid article{border:1px solid #51565e;border-radius:13px;padding:18px;min-width:0}
.aegis-capability-grid p{margin:0;color:#c8cbd1}
.site-footer{padding:26px 20px;text-align:center;border-top:1px solid #383d43;display:flex;gap:18px;flex-wrap:wrap;justify-content:space-between}
.site-footer nav{display:flex;gap:14px;flex-wrap:wrap}
.site-footer a{min-height:44px;display:inline-flex;align-items:center}
:where(a,button,textarea):focus-visible{outline:3px solid currentColor;outline-offset:3px}
html[data-appearance="light"] body{background:#fff;color:#111}
html[data-appearance="light"] body main>section{background:#fff;border-color:#b8b8b8;color:#111}
html[data-appearance="light"] body .aegis-hero>p:not(.eyebrow),html[data-appearance="light"] body .aegis-capability-grid p,html[data-appearance="light"] body .aegis-disclaimer,html[data-appearance="light"] body .aegis-empty{color:#34383d}
html[data-appearance="light"] body .aegis-links a{border-color:#737b85;color:#151a1f}
html[data-appearance="light"] body .aegis-links a:hover{background:#e9ecef}
html[data-appearance="light"] body .aegis-status{background:#f1f2f4;color:#16191c;border-color:#aeb5bf}
html[data-appearance="light"] body .aegis-chat-form textarea{background:#fff;color:#151719;border-color:#7d838a}
html[data-appearance="light"] body .aegis-chat-actions button{color:#111;background:#f2f2f2;border-color:#707070}
html[data-appearance="light"] body .aegis-chat-actions button[type=submit]{color:#fff;background:#242729}
html[data-appearance="light"] body .aegis-answer-shell{background:#fff;border-color:#adb1b7}
html[data-appearance="light"] body .aegis-capability-grid article{border-color:#b4bac2}
@media(max-width:640px){main{padding:16px 12px 35px}main>section{padding:18px;margin:12px 0}.aegis-capability-grid{grid-template-columns:1fr}.site-header{padding:9px 12px;min-height:64px}.site-brand img{max-width:36vw}.aegis-chat-actions button{flex:1 1 150px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

.aegis-saved[hidden],.aegis-saved-list[hidden],#aegisSavedView[hidden]{display:none}
.aegis-saved input[type=text],.aegis-saved input[type=search],.aegis-saved select{width:100%;min-height:44px;border-radius:10px;padding:10px 12px;font:inherit;background:#111417;border:1px solid #858a92;color:#f1f3f5}
.aegis-check{display:flex;gap:10px;align-items:flex-start;font-weight:600}.aegis-check input{margin-top:4px;width:18px;height:18px}
.aegis-saved-list{list-style:none;margin:12px 0;padding:0;display:grid;gap:10px}
.aegis-saved-list li{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between;border:1px solid #575d65;border-radius:11px;background:#1b1e22;padding:10px 12px}
.aegis-saved-list li>span{flex:1 1 220px;overflow-wrap:anywhere}.aegis-saved-list li small{display:block;color:#bcbfc5}
.aegis-saved-list button,.aegis-saved .aegis-chat-actions button{min-height:44px}
.aegis-saved-list button{border-radius:10px;border:1px solid #858a92;background:#30343a;color:#fff;padding:8px 14px;font:inherit}
#aegisSavedView p{margin:0 0 10px;overflow-wrap:anywhere;white-space:pre-wrap}
html[data-appearance="light"] body .aegis-saved input[type=text],html[data-appearance="light"] body .aegis-saved input[type=search],html[data-appearance="light"] body .aegis-saved select{background:#fff;color:#16191c;border-color:#7b838d}
html[data-appearance="light"] body .aegis-saved-list li{background:#f1f2f4;border-color:#aeb5bf;color:#16191c}
html[data-appearance="light"] body .aegis-saved-list li small{color:#34383d}
html[data-appearance="light"] body .aegis-saved-list button{background:#e9ebed;color:#131517;border-color:#7b838d}
/* AEGIS AI workspace layout (assistant.html). Uses the site's appearance setting (html[data-appearance]) set before first paint by
   appearance.js, so dark is the default and light is plain white with dark text. Every surface is themed here: panels, form
   controls, messages, code blocks, status messages, disclosure, evidence and the saved-conversation list. */
main.aegis-ws{max-width:1240px}
.aegis-ws-grid{display:grid;grid-template-columns:minmax(260px,330px) minmax(0,1fr);gap:20px;align-items:start;margin:20px 0}
.aegis-ws-side{display:grid;gap:16px;min-width:0}
.aegis-ws-card,.aegis-ws-main{border:1px solid #45494f;border-radius:17px;padding:clamp(16px,2.6vw,24px);background:#171717;min-width:0;margin:0}
.aegis-ws-card h2{font-size:1.1rem;margin:.1em 0 .6em}
.aegis-ws-card select,.aegis-ws-card textarea,.aegis-ws-card input[type=text],.aegis-ws-card input[type=search]{width:100%;min-height:44px;border-radius:10px;padding:10px 12px;font:inherit;background:#111417;border:1px solid #858a92;color:#f5f7f8}
.aegis-ws-card label{display:block;font-weight:700;margin:10px 0 6px}
.aegis-ws-card .aegis-check{display:flex}
.aegis-btn,.aegis-chat-actions button{min-height:46px;border-radius:10px;border:1px solid #858a92;background:#30343a;color:#fff;padding:10px 18px;font:700 14px/1.2 inherit;font-family:inherit;cursor:pointer}
.aegis-btn{width:100%}
.aegis-chat-actions button[hidden],.aegis-recovery[hidden]{display:none}
#aegisStop{background:#3a1f1f;border-color:#a05a5a}
.aegis-save-details{border:1px solid #575d65;border-radius:11px;padding:8px 12px;margin:10px 0}
.aegis-save-details summary{cursor:pointer;min-height:44px;display:flex;align-items:center;font-weight:700}
.aegis-save-details[open] summary{margin-bottom:6px}
.aegis-thread{display:grid;gap:12px;align-content:start;min-height:220px;max-height:min(58vh,560px);overflow:auto;padding:14px;border:1px solid #4b5058;border-radius:13px;background:#101214;margin:12px 0 18px;white-space:normal}
.aegis-thread:focus-visible{outline:3px solid currentColor;outline-offset:3px}
.aegis-msg{border:1px solid #4b5058;border-radius:12px;padding:10px 14px;background:#181b1f;max-width:100%;min-width:0}
.aegis-msg--user{background:#23272c;border-color:#6b7178;margin-left:clamp(0px,6vw,64px)}
.aegis-msg--assistant{margin-right:clamp(0px,6vw,64px)}
.aegis-msg[data-state=pending]{opacity:.72}
.aegis-msg[data-state=failed]{border-style:dashed;border-color:#b57f7f}
.aegis-msg-who{margin:0 0 4px;font:700 11px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:.14em;text-transform:uppercase;color:#cdd0d3}
.aegis-msg-body p{margin:0 0 10px;white-space:pre-wrap;overflow-wrap:anywhere}
.aegis-msg-body p:last-child{margin-bottom:0}
.aegis-msg-note{margin:8px 0 0;font-size:.85rem;color:#bcbfc5}
.aegis-code{margin:8px 0;padding:12px;border-radius:9px;background:#0a0c0e;border:1px solid #3d424a;color:#eceff1;overflow:auto;max-width:100%;font:13px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace;white-space:pre}
.aegis-code code{font:inherit;background:none;color:inherit}
.aegis-status[data-tone=error]{border-color:#c18d8d;background:#2a1b1b}
.aegis-status[data-tone=ok]{border-color:#7ea58a}
.aegis-status[data-tone=busy]{border-style:dashed}
.aegis-recovery{margin:-8px 0 14px}
.aegis-recovery a{display:inline-flex;align-items:center;min-height:44px;font-weight:700}
#aegisAskEvidence{border:1px solid #575d65;border-radius:12px;background:#1b1e22;padding:10px 14px;margin:0 0 16px;font-size:.92rem}
#aegisAskEvidence p{margin:0 0 6px}#aegisAskEvidence ul{margin:0;padding-left:20px}
.aegis-ws-saved-view{border:1px solid #575d65;border-radius:12px;background:#1b1e22;padding:12px 14px;margin:0 0 16px;white-space:normal}
.aegis-ws-saved-view p{margin:0 0 8px;white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:900px){.aegis-ws-grid{grid-template-columns:1fr}.aegis-ws-main{order:-1}.aegis-thread{max-height:50vh}.aegis-msg--user,.aegis-msg--assistant{margin-left:0;margin-right:0}}
@media(max-width:640px){.aegis-chat-actions button{flex:1 1 140px}}

html[data-appearance="light"] body .aegis-ws-card,html[data-appearance="light"] body .aegis-ws-main{background:#fff;border-color:#b8b8b8;color:#111}
html[data-appearance="light"] body .aegis-ws-card select,html[data-appearance="light"] body .aegis-ws-card input[type=text],html[data-appearance="light"] body .aegis-ws-card input[type=search]{background:#fff;color:#151719;border-color:#7d838a}
html[data-appearance="light"] body .aegis-btn,html[data-appearance="light"] body .aegis-chat-actions button{background:#f2f2f2;color:#111;border-color:#707070}
html[data-appearance="light"] body .aegis-chat-actions button[type=submit]{background:#242729;color:#fff}
html[data-appearance="light"] body #aegisStop{background:#fbeaea;border-color:#a14a4a;color:#4a1010}
html[data-appearance="light"] body .aegis-save-details{border-color:#aeb5bf}
html[data-appearance="light"] body .aegis-thread{background:#fff;border-color:#adb1b7}
html[data-appearance="light"] body .aegis-msg{background:#f6f7f8;border-color:#b4bac2;color:#111}
html[data-appearance="light"] body .aegis-msg--user{background:#eceef0;border-color:#8d949c}
html[data-appearance="light"] body .aegis-msg[data-state=failed]{border-color:#a14a4a}
html[data-appearance="light"] body .aegis-msg-who{color:#2b3036}
html[data-appearance="light"] body .aegis-msg-note{color:#34383d}
html[data-appearance="light"] body .aegis-code{background:#f1f2f4;border-color:#aeb5bf;color:#14181c}
html[data-appearance="light"] body .aegis-status[data-tone=error]{background:#fbeaea;border-color:#a14a4a;color:#3b0d0d}
html[data-appearance="light"] body .aegis-status[data-tone=ok]{background:#eef6f0;border-color:#5f8a6b;color:#10261a}
html[data-appearance="light"] body #aegisAskEvidence,html[data-appearance="light"] body .aegis-ws-saved-view{background:#f1f2f4;border-color:#aeb5bf;color:#16191c}
html[data-appearance="light"] body .aegis-empty{color:#34383d}
#aegisAskEvidence,#aegisAskEvidence li,.aegis-status,.aegis-ws-card,.aegis-save-details li,#aegisSavedList li{overflow-wrap:anywhere}

.aegis-ws-card textarea{width:100%;min-height:76px;border-radius:10px;padding:10px 12px;font:inherit;background:#111417;border:1px solid #6a717a;color:#f2f2f2;resize:vertical}
.aegis-diff span{display:block;white-space:pre}.aegis-diff-add{background:#2b2f35;color:#fff}.aegis-diff-del{background:#0d0f11;color:#b4bac2}
html[data-appearance="light"] body .aegis-ws-card textarea{background:#fff;border-color:#6b7480;color:#111}
html[data-appearance="light"] body .aegis-diff-add{background:#dfe3e8;color:#000}html[data-appearance="light"] body .aegis-diff-del{background:#f6f7f8;color:#4a525c}
