.agent-mail-glyph{font:700 12px/1 Georgia,serif;color:#63b7dd}
.agent-email-dialog{width:min(760px,calc(100vw - 32px));max-height:calc(100vh - 32px);padding:0;border:1px solid #3e3e3e;border-radius:16px;background:#181818;color:#ededed;box-shadow:0 28px 80px #000a}
.agent-email-dialog::backdrop{background:#070a0dc7;backdrop-filter:blur(4px)}
.agent-email-sheet{display:grid;gap:18px;padding:22px;overflow:auto;max-height:calc(100vh - 76px)}
.agent-email-sheet>header{display:flex;align-items:flex-start;justify-content:space-between;gap:18px}
.agent-email-sheet>header h2{margin:3px 0 5px;font-size:22px}.agent-email-sheet>header p:last-child{margin:0;color:#9a9a9a;font-size:12px;line-height:1.5}
.agent-email-sheet>header>button{border:0;background:transparent;color:#9a9a9a;font-size:25px;cursor:pointer}
.agent-email-connection{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;gap:12px;padding:14px;border:1px solid #3a3a3a;border-radius:12px;background:#1e1e1e}
.agent-email-provider{display:grid;place-items:center;width:42px;height:42px;border-radius:10px;background:#2467a7;color:white;font:700 18px/1 Georgia,serif}
.agent-email-connection>div{display:flex;min-width:0;flex-direction:column;gap:3px}.agent-email-connection small{color:#808080;font:700 8px/1.2 var(--font-mono);letter-spacing:.08em}.agent-email-connection strong{font-size:12px}.agent-email-connection span:not(.agent-email-provider){overflow:hidden;color:#9a9a9a;font-size:10px;text-overflow:ellipsis;white-space:nowrap}
.agent-email-sheet button{cursor:pointer}.agent-email-sheet button:disabled{cursor:not-allowed;opacity:.45}.agent-email-sheet .text-button{border:0;background:transparent;color:#76a9d5;font-size:10px}
.agent-email-form{display:grid;gap:13px;padding:16px;border:1px solid #3a3a3a;border-radius:12px;background:#1c1c1c}
.agent-email-form label{display:grid;gap:6px;color:#b7b7b7;font-size:10px;font-weight:700}.agent-email-recipient-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.agent-email-form input,.agent-email-form textarea{box-sizing:border-box;width:100%;border:1px solid #444444;border-radius:8px;outline:0;background:#161616;color:#f2f2f2;padding:10px 11px;font:12px/1.5 var(--font-ui)}.agent-email-form textarea{resize:vertical}.agent-email-form input:focus,.agent-email-form textarea:focus{border-color:#568fba;box-shadow:0 0 0 2px #568fba24}
.agent-email-form>footer,.agent-email-review>footer{display:flex;align-items:center;justify-content:space-between;gap:12px}.agent-email-form>footer>span{color:#7c7c7c;font-size:9px}
.agent-email-sheet .primary,.agent-email-sheet .secondary{border:1px solid #4a4a4a;border-radius:8px;padding:9px 12px;font-size:10px;font-weight:800}.agent-email-sheet .primary{border-color:#377aa9;background:#377aa9;color:#fff}.agent-email-sheet .secondary{background:#272727;color:#dcdcdc}
.agent-email-review{display:grid;gap:13px;padding:16px;border:1px solid #3b6787;border-radius:12px;background:#14202a}.agent-email-review>header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.agent-email-review h3{margin:4px 0 0;font-size:15px}.agent-email-review>header>span{border:1px solid #6b6b6b;border-radius:999px;color:#8fc6e8;padding:5px 8px;font:700 8px/1 var(--font-mono);text-transform:uppercase}
.agent-email-review dl{display:grid;gap:7px;margin:0}.agent-email-review dl>div{display:grid;grid-template-columns:52px 1fr;gap:8px}.agent-email-review dt{color:#828282;font-size:9px}.agent-email-review dd{margin:0;overflow-wrap:anywhere;color:#d4d4d4;font-size:10px}.agent-email-review pre{max-height:230px;overflow:auto;margin:0;border:1px solid #424242;border-radius:8px;background:#101820;color:#e3e3e3;padding:12px;white-space:pre-wrap;overflow-wrap:anywhere;font:11px/1.55 var(--font-ui)}
.agent-email-confirm{display:flex;align-items:flex-start;gap:9px;color:#c7c7c7;font-size:10px;line-height:1.45}.agent-email-confirm input{margin-top:2px;accent-color:#4e91bc}
.agent-email-history{display:grid;gap:9px}.agent-email-history>header{display:flex;align-items:center;justify-content:space-between}.agent-email-history>header strong{font-size:11px}.agent-email-history #outlook-action-list{display:grid;gap:7px}.agent-email-history article{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:10px 12px;border:1px solid #363636;border-radius:9px;background:#1b1b1b}.agent-email-history article div{display:grid;gap:3px;min-width:0}.agent-email-history article strong{overflow:hidden;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.agent-email-history article small,.agent-email-history p{margin:0;color:#848484;font-size:9px}.agent-email-history article>span{align-self:start;border-radius:999px;background:#2c2c2c;color:#b4b4b4;padding:4px 7px;font:700 8px/1 var(--font-mono);text-transform:uppercase}.agent-email-history article>span.succeeded{background:#1e3b2c;color:#83d3a6}.agent-email-history article>span.unknown,.agent-email-history article>span.failed{background:#402728;color:#efaaa7}
html[data-theme="light"] .agent-email-dialog{border-color:#d2d2d2;background:#fff;color:#272727;box-shadow:0 24px 70px #26333f35}html[data-theme="light"] .agent-email-dialog::backdrop{background:#d8e0e6b8}html[data-theme="light"] .agent-email-connection,html[data-theme="light"] .agent-email-form{border-color:#dcdcdc;background:#f8f8f8}html[data-theme="light"] .agent-email-form input,html[data-theme="light"] .agent-email-form textarea{border-color:#d3d3d3;background:#fff;color:#17232c}html[data-theme="light"] .agent-email-review{border-color:#8ab1cb;background:#f0f7fb}html[data-theme="light"] .agent-email-review pre{border-color:#c2d5e2;background:#fff;color:#323232}html[data-theme="light"] .agent-email-history article{border-color:#dedede;background:#fbfbfb}
@media(max-width:620px){.agent-email-dialog{width:100vw;max-width:none;max-height:100vh;border-width:0;border-radius:0}.agent-email-sheet{max-height:calc(100vh - 44px);padding:16px}.agent-email-connection{grid-template-columns:auto 1fr}.agent-email-connection>button{grid-column:2}.agent-email-recipient-row{grid-template-columns:1fr}.agent-email-form>footer,.agent-email-review>footer{align-items:stretch;flex-direction:column}.agent-email-form>footer button,.agent-email-review>footer button{width:100%}}

/* AI-first mail flow */
.agent-email-dialog{width:min(800px,calc(100vw - 32px));border-radius:18px}.agent-email-sheet{gap:16px;padding:24px;max-height:calc(100vh - 34px)}
.agent-email-steps{display:grid;grid-template-columns:repeat(3,1fr);gap:0;margin:0;padding:0;list-style:none}.agent-email-steps li{position:relative;display:grid;grid-template-columns:28px minmax(0,1fr);align-items:center;gap:8px;color:#747474}.agent-email-steps li:not(:last-child)::after{content:"";position:absolute;z-index:0;top:14px;right:10px;left:38px;height:1px;background:#383838}.agent-email-steps li>span{position:relative;z-index:1;display:grid;place-items:center;width:28px;height:28px;border:1px solid #434343;border-radius:50%;background:#1c1c1c;font:700 10px/1 var(--font-mono)}.agent-email-steps li>div{position:relative;z-index:1;width:max-content;max-width:calc(100% - 8px);padding-right:8px;background:#181818}.agent-email-steps strong,.agent-email-steps small{display:block}.agent-email-steps strong{font-size:10px}.agent-email-steps small{margin-top:2px;font-size:8px;font-weight:500}.agent-email-steps li.active,.agent-email-steps li.complete{color:#bfe5f5}.agent-email-steps li.active>span{border-color:#55a9cb;background:#18313c;color:#7fd2ef}.agent-email-steps li.complete>span{border-color:#4a8f68;background:#172d21;color:#74d49a}.agent-email-steps li.complete:not(:last-child)::after{background:#38674d}
.agent-email-ai{display:grid;gap:13px;padding:18px;border:1px solid #31566e;border-radius:14px;background:linear-gradient(145deg,#17242c,#1c1c1c 58%)}.agent-email-ai>header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.agent-email-ai h3{margin:4px 0 0;font-size:16px}.agent-email-local{display:flex;align-items:center;gap:6px;flex:0 0 auto;border:1px solid #34566b;border-radius:999px;padding:6px 8px;color:#90cce5;font:700 8px/1 var(--font-mono);letter-spacing:.04em}.agent-email-local i{width:6px;height:6px;border-radius:50%;background:#5bd58c;box-shadow:0 0 0 3px #5bd58c14}.agent-email-brief{display:grid;gap:7px}.agent-email-brief>span{color:#b7b7b7;font-size:10px;font-weight:700}.agent-email-brief textarea{box-sizing:border-box;width:100%;min-height:104px;border:1px solid #5c5c5c;border-radius:10px;outline:0;background:#161616;color:#f2f2f2;padding:13px 14px;resize:vertical;font:12px/1.55 var(--font-ui)}.agent-email-brief textarea:focus{border-color:#69afd0;box-shadow:0 0 0 3px #568fba24}.agent-email-brief textarea::placeholder{color:#757575}.agent-email-ai>footer{display:flex;align-items:center;justify-content:space-between;gap:16px}.agent-email-ai>footer small{max-width:470px;color:#7e7e7e;font-size:9px;line-height:1.45}.agent-email-generate{display:inline-flex;align-items:center;justify-content:center;gap:7px;white-space:nowrap}.agent-email-generate span{font-size:13px}.agent-email-ai-result{display:grid;gap:5px;border-top:1px solid #404040;padding-top:11px;color:#b8b8b8;font-size:10px;line-height:1.45}.agent-email-ai-result.success{color:#8dd5aa}.agent-email-ai-result.error{color:#efaaa7}.agent-email-ai-result strong{color:inherit}.agent-email-ai-result ul{display:grid;gap:4px;margin:0;padding-left:16px}
.agent-email-editor{border:1px solid #3a3a3a;border-radius:12px;background:#1c1c1c}.agent-email-editor>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px;list-style:none;cursor:pointer}.agent-email-editor>summary::-webkit-details-marker{display:none}.agent-email-editor>summary>span{display:flex;align-items:center;gap:10px}.agent-email-editor>summary b{display:grid;place-items:center;width:26px;height:26px;border:1px solid #464646;border-radius:50%;color:#9d9d9d;font:700 10px/1 var(--font-mono)}.agent-email-editor>summary strong,.agent-email-editor>summary small{display:block}.agent-email-editor>summary strong{font-size:11px}.agent-email-editor>summary small{margin-top:3px;color:#828282;font-size:9px;font-weight:500}.agent-email-editor>summary>i{color:#828282;font-style:normal;transition:transform .2s}.agent-email-editor[open]>summary>i{transform:rotate(180deg)}.agent-email-editor .agent-email-form{border:0;border-top:1px solid #323232;border-radius:0;background:transparent;padding-top:15px}
.agent-email-refine{display:flex;align-items:center;flex-wrap:wrap;gap:6px;padding:10px;border:1px solid #373737;border-radius:9px;background:#191919}.agent-email-refine>span{margin-right:3px;color:#8c8c8c;font:700 8px/1 var(--font-mono);letter-spacing:.06em;text-transform:uppercase}.agent-email-refine button{border:1px solid #424242;border-radius:999px;background:#242424;color:#c2c2c2;padding:6px 9px;font-size:9px}.agent-email-refine button:hover{border-color:#5083a1;color:#dff3fb}
.agent-email-history{display:grid;gap:9px;border-top:1px solid #303030;padding-top:12px}.agent-email-history>summary{display:flex;align-items:center;justify-content:space-between;list-style:none;cursor:pointer}.agent-email-history>summary::-webkit-details-marker{display:none}.agent-email-history>summary strong{font-size:10px}.agent-email-history>summary span,.agent-email-history>header small{color:#828282;font-size:9px}.agent-email-history>header{padding-top:8px}
html[data-theme="light"] .agent-email-steps li>div{background:#fff}html[data-theme="light"] .agent-email-steps li>span,html[data-theme="light"] .agent-email-editor{border-color:#dcdcdc;background:#f8f8f8}html[data-theme="light"] .agent-email-ai{border-color:#a9c8da;background:linear-gradient(145deg,#f0f8fc,#fafafa)}html[data-theme="light"] .agent-email-brief textarea{border-color:#d3d3d3;background:#fff;color:#17232c}html[data-theme="light"] .agent-email-refine{border-color:#dcdcdc;background:#f6f6f6}html[data-theme="light"] .agent-email-refine button{border-color:#d3d3d3;background:#fff;color:#565656}
@media(max-width:680px){.agent-email-dialog{width:100vw;max-width:none;max-height:100vh;border-width:0;border-radius:0}.agent-email-sheet{max-height:100vh;padding:16px}.agent-email-steps small{display:none}.agent-email-steps li{grid-template-columns:26px 1fr}.agent-email-steps li>span{width:26px;height:26px}.agent-email-steps li:not(:last-child)::after{top:13px;left:34px}.agent-email-ai>footer{align-items:stretch;flex-direction:column}.agent-email-ai>footer button{width:100%}.agent-email-refine>span{width:100%;margin-bottom:2px}}

/* Outlook authorization lives inside the Agent conversation. Microsoft sign-in
   itself opens in a secure popup because identity pages cannot be embedded. */
.agent-inline-auth{display:grid;grid-template-columns:34px minmax(0,1fr);gap:9px;margin-top:11px;padding:11px;border:1px solid #434343;border-radius:10px;background:#1e1e1e}.agent-inline-auth.connected{border-color:#345b47;background:#16221c}.agent-inline-auth-mark{display:grid;place-items:center;width:34px;height:34px;border-radius:8px;background:#2467a7;color:#fff;font:700 15px/1 Georgia,serif}.agent-inline-auth>div{display:grid;align-content:start;gap:3px;min-width:0}.agent-inline-auth>div small{color:#848484;font:700 7px/1.2 var(--font-mono);letter-spacing:.07em}.agent-inline-auth>div strong{color:#e6e6e6;font-size:9px}.agent-inline-auth>div p{margin:0;color:#999999;font-size:8px;line-height:1.42}.agent-inline-auth>footer{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:6px;padding-top:2px}.agent-inline-auth>footer button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:30px;border:1px solid #426b87;border-radius:7px;background:#20384a;color:#dcecf6;padding:7px 9px;font-size:8px;font-weight:800;cursor:pointer}.agent-inline-auth>footer button+button{border-color:#47795c;background:#1f3b2b;color:#dff3e6}.agent-inline-auth>footer button:disabled{border-color:#3c3c3c;background:#262626;color:#7a7a7a;cursor:not-allowed}.agent-inline-auth-ok{align-self:center;color:#78d49c;font:700 8px/1 var(--font-mono);text-transform:uppercase}
html[data-theme="light"] .agent-inline-auth{border-color:#d3d3d3;background:#fff}html[data-theme="light"] .agent-inline-auth.connected{border-color:#b8d4c3;background:#f3faf6}html[data-theme="light"] .agent-inline-auth>div strong{color:#333333}html[data-theme="light"] .agent-inline-auth>div p{color:#707070}
.agent-rbz-card{border-color:#496a57;background:#17221c}.agent-rbz-card .agent-inline-auth-mark{background:#315d45;font:800 10px/1 var(--font-mono)}.agent-rbz-card .agent-rbz-meta{color:#a5a5a5}.agent-rbz-card .agent-rbz-warning{color:#e0bd72}.agent-rbz-card>footer{align-items:center}.agent-rbz-card>footer span{color:#939393;font-size:8px;line-height:1.4}.agent-rbz-download{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:30px;border:1px solid #4a805f;border-radius:7px;background:#224c34;color:#e3f6e9;padding:7px 10px;font-size:8px;font-weight:800;text-decoration:none}.agent-rbz-download:hover{border-color:#70b586;background:#2a6040;color:#fff}
html[data-theme="light"] .agent-rbz-card{border-color:#b8d4c3;background:#f3faf6}html[data-theme="light"] .agent-rbz-card .agent-rbz-warning{color:#8b5d06}html[data-theme="light"] .agent-rbz-download{background:#e7f4eb;color:#245437}
.agent-inline-auth:has([data-agent-connect-outlook]:not(:disabled)) { cursor: pointer; }
.agent-inline-auth:has([data-agent-connect-outlook]:not(:disabled)):hover { border-color: #5d9dd0; }
