/* Madison is a persistent, focused workspace inside the existing hub. */
.md-shell{display:grid;grid-template-columns:185px minmax(0,1fr);border:1px solid #2c353b;border-radius:14px;background:#14191d;overflow:hidden;min-height:670px;box-shadow:0 18px 50px #0002}.md-history{background:#10161a;border-right:1px solid #28343b;padding:21px 15px;display:flex;flex-direction:column;min-width:0}.md-history-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:19px}.md-history-head>span{font-size:8px;letter-spacing:1.7px;color:#718a98;font-weight:600}.md-history-head>button{display:grid;place-items:center;background:#212f36;border:1px solid #334852;color:#b8cbd5;width:23px;height:23px;border-radius:5px;font-size:17px;line-height:1}.md-new-chat{display:flex;align-items:center;gap:8px;text-align:left;background:#b4f0000e;border:1px solid #b4f0002a;color:#b9d89a;border-radius:7px;padding:11px 9px;font-size:10px;line-height:1.4}.md-new-chat svg{width:13px;height:13px;color:#b4f000}.md-new-chat b{font-size:12px;font-weight:400;margin-left:auto}.md-conversation-list{display:flex;flex-direction:column;gap:5px;padding-top:18px;max-height:450px;overflow-y:auto}.md-conversation-list>button{background:transparent;color:#8ca6b5;padding:12px 10px;border-radius:7px;text-align:left;border:1px solid transparent;min-width:0}.md-conversation-list>button:hover{background:#1c2a32}.md-conversation-list>button.active{background:#20302e;border-color:#41543d}.md-conversation-list>button strong{font-size:11px;font-weight:400;line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.md-conversation-list>button span{font-size:8px;color:#5f8192;display:block;margin-top:5px}.md-conversation-list>p{font-size:10px;color:#4e7184;line-height:1.9;padding:8px 8px}.md-history-footer{display:flex;align-items:center;gap:8px;padding-top:18px;margin-top:auto;border-top:1px solid #24363f}.md-history-avatar{display:grid;place-items:center;width:28px;height:28px;border-radius:8px;background:#27371c;border:1px solid #b4f00037;color:#b4f000;font-family:'Hustle Condensed',sans-serif;font-size:17px}.md-history-footer strong{display:block;font-size:11px;color:#b6cabc;font-weight:550}.md-history-footer div>span{font-size:8px;color:#698a7d;display:block;margin-top:3px}.md-conversation{display:flex;flex-direction:column;min-width:0;background:radial-gradient(ellipse at 50% 30%,#b4f00003,transparent 70%),#151b1f}.md-conversation-header{display:flex;justify-content:space-between;align-items:center;gap:15px;padding:20px 25px;border-bottom:1px solid #293940;min-height:87px}.md-identity{display:flex;align-items:center;gap:10px}.md-identity>span{display:grid;place-items:center;background:#b4f0000a;border:1px solid #b4f0002e;color:#b4f000;width:35px;height:35px;border-radius:11px}.md-identity svg{width:20px;height:20px}.md-identity h2{font-size:18px;letter-spacing:-.2px;color:#e0eef3;line-height:1.15;font-weight:550}.md-identity h2 i{font-style:normal;font-size:7px;color:#b4f000;border:1px solid #b4f0004a;border-radius:3px;padding:1px 3px;vertical-align:middle;margin-left:4px;letter-spacing:.6px}.md-identity p{font-size:9px;color:#7396a8;margin-top:5px}.md-context{display:flex;flex-direction:column;gap:6px;align-items:flex-end;max-width:170px}.md-context>span{font-size:6px;letter-spacing:1.6px;color:#597e91}.md-context select{max-width:170px;min-width:110px;background:transparent;border:0;color:#9db8c7;font-size:10px;padding:0 0 3px;outline-offset:5px;text-align:right}.md-context option{background:#1a2830;color:#c1d4df}.md-chat-log{flex:1;overflow-y:auto;max-height:590px;min-height:360px;padding:25px 25px 10px;scrollbar-width:thin;scrollbar-color:#344d5b transparent}.md-welcome{text-align:center;padding:18px 0 16px;max-width:550px;margin:0 auto}.md-director-symbol{width:53px;height:53px;display:grid;place-items:center;border:1px solid #b4f00037;border-radius:15px;background:#b4f00008;color:#b4f000;position:relative;margin:0 auto 22px;box-shadow:0 0 40px #b4f00004}.md-director-symbol>svg{width:27px;height:27px}.md-director-symbol>span{position:absolute;right:-3px;bottom:-3px;width:9px;height:9px;border-radius:50%;background:#b4f000;border:2px solid #172127}.md-small-label{font-size:7px;letter-spacing:1.9px;font-weight:600;color:#6c96a2}.md-welcome>.md-small-label{color:#8aab81;font-size:7px;letter-spacing:1.7px}.md-welcome h2{font-size:35px;font-weight:500;letter-spacing:-1.3px;line-height:1.15;color:#e8f0f4;margin-top:14px}.md-welcome h2 em{font-style:normal;color:#b4f000}.md-welcome>p{font-size:12px;line-height:1.85;color:#7f9fad;max-width:380px;margin:17px auto 24px}.md-suggestions{display:grid;gap:8px;max-width:390px;margin:0 auto;text-align:left}.md-suggestions>button{position:relative;display:grid;grid-template-columns:22px 1fr 15px;gap:3px 9px;background:#1a262d;border:1px solid #30444e;border-radius:8px;padding:12px 14px;text-align:left;color:#c3d6df}.md-suggestions>button:hover{border-color:#b4f00062;background:#202f2a}.md-suggestions>button>span{grid-row:1/3;font-size:8px;color:#5b8496;padding-top:3px}.md-suggestions strong{font-size:11px;font-weight:500}.md-suggestions small{grid-column:2;font-size:9px;color:#688f9f;line-height:1.5}.md-suggestions i{grid-column:3;grid-row:1/3;align-self:center;font-size:15px;font-style:normal;color:#82ad82}.md-composer{margin:17px 24px 0;border:1px solid #455b60;border-radius:11px;background:#1a262d;padding:14px 15px 10px;box-shadow:0 3px 15px #0001}.md-composer:focus-within{border-color:#b4f00087;box-shadow:0 0 0 2px #b4f00006}.md-composer textarea{display:block;width:100%;min-height:43px;max-height:180px;resize:vertical;border:0;outline:none;background:transparent;color:#d0e2ec;font-size:13px;line-height:1.6;padding:0}.md-composer textarea::placeholder{color:#678a9c}.md-composer textarea:focus-visible{outline:0}.md-composer-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:7px}.md-composer-bottom>span{display:flex;align-items:center;gap:5px;color:#577d83;font-size:8px;line-height:1.4}.md-composer-bottom>span svg{width:10px;height:10px;color:#789e65}.md-composer-bottom>button{width:30px;height:30px;display:grid;place-items:center;border-radius:7px;background:#b4f000;color:#182a05;flex-shrink:0}.md-composer-bottom>button svg{width:17px;height:17px}.md-composer-bottom>button:disabled{opacity:.35;cursor:default}.md-composer-note{font-size:8px;color:#567784;line-height:1.7;text-align:center;padding:10px 24px 16px}.md-brief{background:#111b20;border-left:1px solid #293c45;padding:24px 20px;min-width:0}.md-brief-title{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:8px;letter-spacing:1.7px;color:#7395a3;margin-bottom:27px}.md-brief-title i{width:5px;height:5px;border-radius:50%;background:#b4f000;box-shadow:0 0 12px #b4f00044}.md-rhythm>span{font-size:7px;letter-spacing:1.3px;color:#678f9f}.md-rhythm>strong{display:block;color:#e3f1f4;font-family:'Hustle Condensed',sans-serif;font-weight:700;font-size:42px;line-height:1.05;letter-spacing:-1px;margin:10px 0 8px}.md-rhythm>p{font-size:10px;color:#88a9b4}.md-time-confirmed{font-size:8px;line-height:1.7;color:#7f9e72;margin-top:13px}.md-brief-block{border-top:1px solid #29404a;padding-top:24px;margin-top:24px}.md-brief-block h3{font-size:16px;font-weight:400;letter-spacing:-.25px;color:#c7dfe8;margin:10px 0}.md-brief-block>p{font-size:11px;line-height:1.8;color:#759bac}.md-brief-block>.md-empty-brief{font-size:9px;color:#587e8f;margin-top:12px;border-left:1px solid #43642f;padding-left:10px}.md-next-slot{background:#1e2d29;border:1px solid #3b5234;border-radius:7px;padding:11px;margin-top:13px}.md-next-slot>span{font-size:8px;color:#85a777}.md-next-slot strong{display:block;font-size:12px;color:#c4deb8;font-weight:500;margin:7px 0}.md-next-slot small{display:block;font-size:8px;line-height:1.7;color:#719b6a}.md-brief-block ul{list-style:none;margin:15px 0 0;padding:0;display:grid;gap:15px}.md-brief-block li{display:flex;align-items:center;gap:6px;font-size:9px;color:#789fae}.md-brief-block li>strong{margin-left:auto;font-weight:400;font-size:9px;color:#b0cad4}.md-brief-block li i{width:4px;height:4px;border-radius:50%;flex-shrink:0}.md-lime{background:#b4f000}.md-amber{background:#c49c57}.md-brief-link{display:flex;justify-content:space-between;align-items:center;width:100%;font-size:10px;background:transparent;border-top:1px solid #29404a;color:#91b0a0;padding:14px 0;text-align:left}.md-brief-link:first-of-type{margin-top:24px}.md-brief-link>span{color:#b4f000}.md-principle{font-size:9px;line-height:1.9;color:#4f7986;margin-top:27px}.md-principle strong{font-weight:400;color:#8ca772}.md-message{display:flex;align-items:flex-start;gap:12px;margin:8px 0 27px}.md-message-avatar{display:grid;place-items:center;width:29px;height:29px;background:#27382b;color:#b4f000;border:1px solid #42593c;border-radius:8px;flex-shrink:0;font-size:11px}.md-message-avatar svg{width:16px;height:16px}.md-user .md-message-avatar{background:#283b49;border-color:#3c5769;color:#adcbdc}.md-message-content{min-width:0;flex:1}.md-message-label{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:2px 0 10px}.md-message-label strong{color:#c7dde7;font-weight:500;font-size:12px}.md-message-label>span{font-size:6px;letter-spacing:1px;color:#77a06b}.md-message-label time{font-size:7px;color:#527c8f;margin-left:auto}.md-message-text{color:#9db9c9;font-size:12px;line-height:1.85;overflow-wrap:anywhere}.md-message-text p+p{margin-top:12px}.md-user .md-message-text{color:#c0d4df}.md-user .md-message-content{background:#1b2a34;border:1px solid #2f4756;padding:12px 15px;border-radius:0 10px 10px 10px}.md-working strong{font-size:11px;color:#bdd6a2;font-weight:400}.md-working p{font-size:10px;color:#6d9485;margin-top:6px}.md-working>div:last-child>span{display:flex;gap:4px;margin-top:10px}.md-working i{width:4px;height:4px;border-radius:50%;background:#b4f000;animation:md-pulse 1.2s infinite}.md-working i:nth-child(2){animation-delay:.2s}.md-working i:nth-child(3){animation-delay:.4s}.md-send-spinner{width:13px;height:13px;border:1.5px solid #2d460455;border-top-color:#1b3000;border-radius:50%;animation:md-spin .8s linear infinite}.md-error{background:#432c22;color:#edbc9d;border:1px solid #7d5138;border-radius:8px;font-size:11px;line-height:1.8;padding:12px 14px;margin:15px 0}.md-setup{display:flex;align-items:flex-start;gap:9px;margin:15px 24px 0;padding:12px;border:1px solid #635235;background:#302d20;border-radius:8px}.md-setup>span{color:#c1a567;padding-top:1px}.md-setup svg{width:14px;height:14px}.md-setup strong{font-size:10px;font-weight:500;color:#d3c396}.md-setup p{font-size:9px;line-height:1.8;color:#9d916e;margin-top:5px}.md-setup button{font-size:9px;white-space:nowrap;color:#c7b37d;background:transparent;padding:0;margin-left:auto}.md-actions{display:grid;gap:7px;margin-top:15px}.md-actions>div{display:flex;align-items:center;gap:8px;border:1px solid #3a5340;background:#202f26;border-radius:7px;padding:10px}.md-actions svg{width:13px;height:13px;color:#b4f000}.md-actions p{font-size:10px;line-height:1.6;color:#abc59e;overflow-wrap:anywhere}.md-actions small{display:block;font-size:9px;color:#bb9874;margin-top:4px}.md-actions button{font-size:9px;background:transparent;color:#b4f000;margin-left:auto;white-space:nowrap}.md-shell button:disabled{cursor:default}.st-body:has(.md-shell){margin-top:-2px}
@keyframes md-pulse{0%,70%,100%{opacity:.25}35%{opacity:1}}@keyframes md-spin{to{transform:rotate(360deg)}}
@media(min-width:1650px){.md-shell{grid-template-columns:205px minmax(0,1fr);min-height:730px}.md-history{padding:25px 18px}.md-conversation-header{padding:24px 30px}.md-chat-log{padding:30px 35px 15px;max-height:640px}.md-welcome{padding-top:27px}.md-welcome h2{font-size:42px}.md-welcome>p{font-size:13px;max-width:410px}.md-suggestions{max-width:430px}.md-suggestions strong{font-size:12px}.md-suggestions small{font-size:10px}.md-suggestions>button{padding:14px 16px}.md-composer{margin:20px 30px 0}.md-brief{padding:28px 24px}.md-message-text{font-size:13px}}
@media(max-width:1400px){.md-shell{grid-template-columns:155px minmax(0,1fr)}.md-history{padding:19px 12px}.md-brief{padding:22px 16px}.md-conversation-header{padding:19px 20px}.md-identity h2{font-size:17px}.md-context{max-width:130px}.md-context select{max-width:130px;font-size:9px}.md-chat-log{padding:20px 20px 10px}.md-welcome h2{font-size:32px}.md-welcome>p{font-size:11px}.md-suggestions>button{padding:11px 12px}.md-composer{margin:15px 20px 0}.md-composer-note{padding:10px 20px 16px;font-size:7px}.md-composer-bottom>span{font-size:7px}.md-setup{margin-left:20px;margin-right:20px}.md-brief-block li{font-size:8px}.md-brief-block li strong{font-size:8px}.md-rhythm strong{font-size:39px}.md-history-head>span{font-size:7px;letter-spacing:1.2px}.md-new-chat{font-size:9px;padding:10px 7px}.md-new-chat svg{width:12px;height:12px}.md-history-footer div>span{font-size:7px}}
@media(max-width:1180px){.md-shell{grid-template-columns:minmax(0,1fr)}.md-history{grid-column:1/-1;display:flex;flex-direction:row;align-items:center;gap:15px;border-right:0;border-bottom:1px solid #293c45;padding:12px 18px;min-height:54px}.md-history-head{margin:0;gap:8px}.md-history-head>span{font-size:7px;letter-spacing:1px}.md-history-head button{display:none}.md-new-chat{flex-shrink:0;font-size:9px;padding:8px}.md-new-chat b{display:none}.md-conversation-list{padding:0;display:flex;flex-direction:row;max-height:none;overflow-x:auto;flex:1}.md-conversation-list>button{flex-shrink:0;max-width:150px;padding:7px 9px}.md-conversation-list>button strong{font-size:9px;-webkit-line-clamp:1}.md-conversation-list>button span{display:none}.md-conversation-list>p{padding:0;font-size:8px;line-height:1.5;white-space:nowrap}.md-conversation-list>p br{display:none}.md-history-footer{display:none}.md-conversation{grid-column:1}.md-brief{grid-column:2;grid-row:2}.md-welcome{padding-top:16px}.md-chat-log{min-height:380px}.md-welcome h2{font-size:34px}.md-welcome>p{max-width:335px}.md-brief{padding:22px 17px}}
@media(max-width:950px){.md-shell{grid-template-columns:1fr}.md-conversation{grid-column:1}.md-brief{grid-column:1;grid-row:auto;display:grid;grid-template-columns:1fr 1fr;gap:15px 24px;border-left:0;border-top:1px solid #293c45;padding:20px 24px}.md-brief-title{grid-column:1/-1;margin:0}.md-rhythm{grid-column:1}.md-brief-block{margin:0;padding:0;border:0}.md-brief-block:has(ul){grid-column:2;grid-row:2}.md-brief-block:has(h3){grid-column:1;grid-row:3}.md-brief-link{grid-column:2}.md-brief-link:first-of-type{margin-top:0;grid-row:3;align-self:start}.md-brief-link:nth-of-type(2){grid-row:3;align-self:end}.md-principle{grid-column:1/-1;margin:0;font-size:8px;border-top:1px solid #29404a;padding-top:12px}.md-principle br{display:none}.md-principle strong{margin-left:5px}.md-brief-block li{font-size:10px}.md-brief-block li>strong{font-size:10px}.md-chat-log{max-height:550px}.md-welcome{max-width:470px}.md-welcome>p{font-size:12px;max-width:360px}.md-suggestions strong{font-size:12px}.md-suggestions small{font-size:10px}.md-conversation-header{padding:19px 24px}.md-context{max-width:180px}.md-context select{max-width:180px;font-size:10px}.md-context>span{font-size:7px}.md-composer-bottom>span{font-size:8px}.md-composer-note{font-size:8px}}
@media(max-width:560px){.md-shell{border-radius:11px}.md-history{padding:10px 12px;gap:10px;flex-wrap:wrap}.md-history-head{margin-right:auto}.md-history-head>span{font-size:8px}.md-new-chat{font-size:10px;padding:8px 10px}.md-conversation-list{flex-basis:100%;gap:4px}.md-conversation-list:has(>p){display:none}.md-conversation-list>button{max-width:145px}.md-conversation-list>button strong{font-size:10px}.md-conversation-header{padding:17px 15px;gap:10px;flex-wrap:wrap}.md-identity>span{width:32px;height:32px;border-radius:9px}.md-identity h2{font-size:18px}.md-identity p{font-size:9px}.md-context{max-width:130px}.md-context select{max-width:130px;font-size:9px}.md-context>span{font-size:6px}.md-chat-log{padding:19px 15px 10px;min-height:360px;max-height:530px}.md-welcome{padding-top:12px}.md-director-symbol{width:45px;height:45px;border-radius:12px;margin-bottom:20px}.md-director-symbol svg{width:24px;height:24px}.md-welcome>.md-small-label{font-size:6px;letter-spacing:1.4px}.md-welcome h2{font-size:32px;letter-spacing:-.9px;margin-top:13px}.md-welcome>p{font-size:12px;line-height:1.8;margin:16px 4px 23px}.md-suggestions>button{padding:11px 10px;gap:3px 7px;grid-template-columns:18px 1fr 12px}.md-suggestions strong{font-size:11px}.md-suggestions small{font-size:9px}.md-suggestions>button>span{font-size:8px}.md-composer{margin:14px 13px 0;padding:13px 12px 10px}.md-composer textarea{font-size:13px;min-height:44px}.md-composer-bottom>span{font-size:7px;max-width:190px}.md-composer-note{font-size:7px;padding:10px 16px 15px}.md-brief{padding:18px 16px;gap:20px 17px}.md-brief-title{font-size:8px}.md-rhythm>strong{font-size:37px}.md-rhythm>span{font-size:6px}.md-rhythm>p{font-size:9px;line-height:1.6}.md-time-confirmed{font-size:7px}.md-brief-block li{font-size:8px;gap:4px}.md-brief-block li>strong{font-size:8px}.md-brief-block ul{gap:14px}.md-small-label{font-size:6px;letter-spacing:1.4px}.md-brief-block h3{font-size:16px}.md-brief-block>p{font-size:10px}.md-brief-block>.md-empty-brief{font-size:8px}.md-brief-link{font-size:9px;line-height:1.6}.md-principle{font-size:7px;line-height:1.7}.md-message{gap:9px}.md-message-avatar{width:25px;height:25px;border-radius:7px;font-size:10px}.md-message-avatar svg{width:14px;height:14px}.md-message-label{gap:6px}.md-message-label strong{font-size:11px}.md-message-label>span{font-size:5px;letter-spacing:.7px}.md-message-label time{font-size:6px;margin-left:0;width:100%}.md-message-text{font-size:12px;line-height:1.85}.md-user .md-message-content{padding:10px 12px}.md-setup{margin:13px 13px 0;padding:10px;gap:8px;flex-wrap:wrap}.md-setup>div{flex:1;min-width:180px}.md-setup strong{font-size:10px}.md-setup p{font-size:9px}.md-setup button{margin-left:22px;font-size:9px}.md-actions>div{gap:7px}.md-actions p{font-size:9px}.md-next-slot{padding:9px}.md-next-slot strong{font-size:10px}.md-next-slot small{font-size:7px}}
@media(prefers-reduced-motion:reduce){.md-working i,.md-send-spinner{animation:none}}

.md-knowledge{padding:12px 24px;color:#a8be8b;font-size:13px;border-bottom:1px solid #304149;margin:0}

.md-learning{padding:12px 24px;border-bottom:1px solid #304149;color:#b8c8cf;font-size:13px}.md-learning p{line-height:1.6}.md-learning form{display:grid;grid-template-columns:1fr 1fr;gap:12px}.md-learning label{display:grid;gap:6px}.md-learning input,.md-learning select{max-width:100%;background:#17262c;color:#eef2f3;padding:8px;border:1px solid #425d67;border-radius:6px}.md-learning button{padding:8px;background:#c4f400;color:#10191c;border:0;border-radius:6px}.md-learning summary{cursor:pointer}
@media(max-width:560px){.md-learning form{grid-template-columns:minmax(0,1fr);min-width:0}.md-learning label{min-width:0}.md-learning input,.md-learning select{width:100%;min-width:0;box-sizing:border-box}}

/* Chat first: compact controls, composer, then saved messages. */
.md-shell{display:block;min-height:0;box-shadow:none}
.md-conversation-header{min-height:0;padding:16px 20px;gap:12px;flex-wrap:wrap}
.md-identity h2{font-size:20px;margin:0}
.md-chat-controls{display:flex;align-items:center;gap:8px;min-width:0;max-width:100%;flex-wrap:wrap;margin-left:auto}
.md-saved-chats,.md-context{display:block;min-width:0;max-width:200px}
.md-chat-controls select{width:180px;max-width:100%;min-width:0;min-height:38px;padding:8px 26px 8px 10px;border:1px solid #38474e;border-radius:7px;background:#182126;color:#b9cbd3;font-size:12px;text-align:left;outline-offset:3px}
.md-chat-controls select:disabled{opacity:.5}
.md-chat-controls .md-new-chat{min-height:38px;padding:8px 12px;font-size:12px;white-space:nowrap;justify-content:center}
.md-context>span.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.md-composer{margin:16px 20px 0;padding:14px;border-radius:10px}
.md-composer textarea{font-size:14px;min-height:46px}
.md-composer-bottom{justify-content:flex-end;margin-top:4px}
.md-composer-bottom>button{width:36px;height:36px}
.md-chat-log{min-height:0;max-height:520px;padding:20px;flex:none;outline-offset:-3px}
.md-chat-log:has(.md-welcome){padding:12px 20px 20px}
.md-welcome{padding:0;max-width:none;margin:0;text-align:left}
.md-suggestions{display:flex;flex-wrap:wrap;gap:8px;max-width:none;margin:0}
.md-suggestions>button{display:block;padding:8px 12px;font-size:12px;border-radius:7px}
.md-message-label strong{font-size:13px}.md-message-label time{font-size:10px}.md-message-text{font-size:14px;line-height:1.7}
.md-learning{padding:13px 20px;border-top:1px solid #304149;border-bottom:0;font-size:12px;color:#8ea8b5}
.md-learning>summary{width:fit-content}.md-learning h3{font-size:14px;color:#b8c8cf;margin:16px 0 10px}.md-learning p{margin:10px 0}
.md-learning form{margin-top:18px}.md-learning form h3{grid-column:1/-1;margin:0}
.md-knowledge{padding:10px 14px;margin:12px 20px 0;border:1px solid #635235;border-radius:8px;background:#302d20;color:#d3c396;font-size:12px}
.md-setup{margin:12px 20px 0}.md-setup strong{font-size:12px}.md-setup p,.md-setup button{font-size:11px}
@media(max-width:700px){.md-conversation-header{padding:14px 16px}.md-chat-controls{width:100%;display:grid;grid-template-columns:minmax(0,1fr) auto;margin-left:0}.md-saved-chats,.md-context{max-width:none;width:100%}.md-context{grid-column:1/-1}.md-chat-controls select{width:100%}.md-composer{margin:0 16px;padding:12px}.md-chat-log{padding:18px 16px;max-height:460px}.md-chat-log:has(.md-welcome){padding:12px 16px 18px}.md-learning{padding:12px 16px}.md-knowledge,.md-setup{margin:12px 16px 0}.md-message-label time{width:auto;margin-left:auto}.md-message-text{font-size:13px}}

/* Keep the reply readable and the reply box directly below it. */
.md-conversation{height:min(760px,calc(100dvh - var(--md-top,150px) - 18px));min-height:360px}
.md-conversation-header{padding:12px 16px;flex-shrink:0}
.md-identity h2{font-size:18px}
.md-chat-controls{gap:6px}
.md-chat-controls select{min-height:34px;width:170px;font-size:12px;padding:6px 24px 6px 9px}
.md-chat-controls .md-new-chat{min-height:34px;padding:6px 10px}
.md-chat-log,.md-chat-log:has(.md-welcome){flex:1;min-height:80px;max-height:none;padding:18px 20px;overflow-y:auto;overscroll-behavior:contain}
.md-composer{flex-shrink:0;margin:0 16px 14px;padding:10px 12px;display:flex;align-items:flex-end;gap:10px}
.md-composer textarea{flex:1;min-width:0;min-height:44px;max-height:100px;resize:vertical;font-size:14px}
.md-composer-bottom{margin:0;flex-shrink:0}
.md-message{margin:4px 0 22px}
.md-message-content{max-width:78ch}
.md-message-text{line-height:1.65;color:#bbced8}
.md-message-text p+p,.md-message-text p+ul,.md-message-text p+ol,.md-message-text ul+p,.md-message-text ol+p{margin-top:12px}
.md-message-text ul,.md-message-text ol{padding-left:22px;margin:10px 0}
.md-message-text li+li{margin-top:7px}
.md-message-text strong{font-weight:650;color:#edf3f5}
.md-message-text .md-message-heading{margin:16px 0 7px}
.md-message-text .md-message-heading:first-child{margin-top:0}
.md-message-text code{font-size:.92em;background:#0d151b;padding:2px 4px;border-radius:3px;overflow-wrap:anywhere}
.md-message-text pre{max-width:100%;white-space:pre-wrap;overflow-wrap:anywhere;background:#0d151b;padding:12px;border-radius:6px;margin:12px 0}
.md-message-text pre code{padding:0}
.md-setup,.md-knowledge{flex-shrink:0}
@media(max-width:700px){.md-conversation-header{gap:8px}.md-chat-controls{grid-template-columns:minmax(0,1fr) auto}.md-context select{min-height:32px}.md-chat-log,.md-chat-log:has(.md-welcome){padding:16px 14px}.md-composer{margin:0 12px 12px}.md-composer textarea{font-size:16px}.md-message{gap:8px}.md-message-text{font-size:14px}.md-message-label time{font-size:9px}.md-suggestions>button{font-size:12px;padding:8px 10px}}
@media(max-width:700px){.md-conversation-header{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}.md-chat-controls{display:contents}.md-identity{grid-area:1/1}.md-chat-controls .md-new-chat{grid-area:1/2;justify-self:end}.md-saved-chats{grid-area:2/1}.md-context{grid-area:2/2}.md-chat-controls select{width:100%;max-width:100%}}

.md-create-bar{flex-shrink:0;display:flex;justify-content:flex-end;padding:0}.md-create-bar button{background:#b4f000;color:#142000;border:1px solid #b4f000;border-radius:8px;padding:10px 15px;font:inherit;font-size:14px;font-weight:600}.md-create-bar button:disabled{opacity:.5;cursor:default}@media(max-width:700px){.md-chat-controls .md-create-bar{grid-area:3/1/4/3;width:100%;padding:0}.md-create-bar button{width:100%}}

.md-suggestions>.md-create-suggestion{background:#b4f000;border-color:#b4f000;color:#142000;font-weight:600}.md-suggestions>.md-create-suggestion:hover{background:#c4ff10;color:#142000}.md-suggestions>.md-create-suggestion:disabled{opacity:.5;cursor:default}

.md-conversation>.md-welcome{flex-shrink:0;padding:12px 16px;border-bottom:1px solid #293940;margin:0}.md-conversation>.md-welcome .md-suggestions{margin:0;max-width:none}@media(max-width:700px){.md-conversation>.md-welcome{padding:10px 12px}.md-create-suggestion{flex:1 1 100%}}

/* Madison identity portrait, shared by header and assistant messages. */
.md-portrait{display:block;object-fit:cover;object-position:center;width:100%;height:100%;border-radius:inherit}
.md-identity>.md-portrait{width:44px;height:44px;flex:0 0 44px;border-radius:50%;border:1px solid #53666d}
.md-assistant .md-message-avatar{overflow:hidden;border-radius:50%;background:#102126;padding:0}
