:root{font-family:Arial,Helvetica,sans-serif;color:#12234b;background:#f3f5fa;font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button,a,input,select,textarea,summary{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{cursor:wait;opacity:.55}[hidden]{display:none!important}a{color:#1d4a9e;text-underline-offset:3px}button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #779be6;outline-offset:3px}input:focus,textarea:focus,select:focus{outline:2px solid #86a4e7;outline-offset:1px}.topbar{height:72px;background:white;border-bottom:1px solid #e2e7ef;padding:0 32px;display:flex;justify-content:space-between;align-items:center;gap:16px}.topbar>a:last-child{font-size:13px}.brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:#142347}.brand img{width:40px;height:40px}.brand strong{font-size:23px;letter-spacing:1px;display:block}.brand small{font-size:9px;letter-spacing:2px;display:block;margin-top:4px}.workspace{max-width:1500px;margin:0 auto;padding:28px;display:grid;grid-template-columns:minmax(0,1fr) 348px;gap:28px;align-items:start}.dialogue-column{min-width:0}.eyebrow{font-size:10px;font-weight:700;letter-spacing:1.8px;color:#6a7e9e}h1{font-size:34px;letter-spacing:-1px;line-height:1.16;margin:12px 0}.intro>p{color:#566785;font-size:15px;line-height:1.5;margin:0 0 22px}.chat{background:white;border:1px solid #e1e6ef;border-radius:18px;overflow:hidden;display:flex;flex-direction:column;height:calc(100dvh - 251px);min-height:500px;box-shadow:0 8px 32px #15295106}.chat-heading{padding:15px 20px;border-bottom:1px solid #e9ecf2;display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:14px;font-weight:700}.chat-heading i{display:inline-block;width:7px;height:7px;border-radius:50%;background:#5a7ed7;margin-right:9px}.text-button{border:0;background:none;color:#617294;font-size:12px;padding:6px}.messages{display:flex;flex-direction:column;gap:24px;flex:1;overflow:auto;min-height:150px;padding:24px;scroll-behavior:smooth;overscroll-behavior:contain}.message{display:flex;flex-shrink:0;gap:12px;margin:0;align-items:flex-start}.avatar{width:30px;height:30px;flex:none;background:#ecf1fb;border-radius:10px;display:grid;place-items:center;color:#204b9a;font-size:12px;font-weight:700}.message.user{justify-content:flex-end}.message.user .bubble{background:#eef3ff;border-radius:14px 14px 3px 14px;padding:13px 16px;max-width:min(88%,680px);white-space:pre-wrap}.bubble{min-width:0;line-height:1.65;font-size:14px;color:#243650;overflow-wrap:anywhere}.bubble p{margin:0 0 12px}.bubble p:last-child{margin:0}.bubble h2,.bubble h3{font-size:16px;line-height:1.4;margin:18px 0 9px;color:#152b57}.bubble h2:first-child,.bubble h3:first-child{margin-top:0}.bubble ul,.bubble ol{padding-left:22px;margin:8px 0 14px}.bubble li{margin:5px 0}.bubble a{word-break:break-word}.bubble blockquote{margin:10px 0;padding-left:12px;border-left:2px solid #d2ddf2}.portrait-note{font-size:11px;color:#7a88a0;margin-top:8px}.quick-prompts{display:flex;flex-shrink:0;flex-wrap:wrap;gap:10px;margin:0}.quick-prompts button{max-width:100%;min-width:0;white-space:normal;overflow-wrap:anywhere;line-height:1.45;background:#fff;border:1px solid #dbe3f0;border-radius:9px;color:#3b5279;font-size:12px;padding:9px 11px;text-align:left}.quick-prompts button:hover{background:#f2f6fc}.composer{margin:0 18px;display:flex;align-items:flex-end;gap:10px;border:1px solid #d5deed;border-radius:13px;padding:9px;background:#fff}.composer textarea{flex:1;min-width:0;resize:vertical;max-height:160px;border:0;padding:6px 5px;color:#223653;font-size:14px;line-height:1.45}.composer textarea:focus{outline:0}.composer:focus-within{border-color:#6187d0;box-shadow:0 0 0 2px #e4edff}.composer button,.primary{border:0;border-radius:9px;color:white;background:#0a1e64;padding:12px 15px;font-size:13px;font-weight:600}.composer button span{font-size:17px;margin-left:6px}.chat-foot{font-size:11px;color:#8895ab;text-align:center;margin:11px 12px 14px;line-height:1.4}.waiting{display:flex;align-items:center;gap:8px;margin:0 24px 14px;color:#6c7c96;font-size:13px}.spinner{width:14px;height:14px;border:2px solid #e0e7f3;border-top-color:#3d65b7;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.spinner{animation:none}.messages{scroll-behavior:auto}}.error{margin:0 18px 12px;padding:12px;background:#fff4ed;border:1px solid #f3ddc9;border-radius:10px;font-size:13px;color:#764829;line-height:1.5}.error button{background:none;border:0;text-decoration:underline;color:inherit;margin-left:10px}.portrait-panel{background:#fff;border:1px solid #e1e6ef;border-radius:18px;overflow:hidden}.portrait-panel summary{padding:20px;list-style:none;display:flex;justify-content:space-between;align-items:center;cursor:pointer}.portrait-panel summary::-webkit-details-marker{display:none}.portrait-panel summary strong{display:block;font-size:17px}.portrait-panel summary small{display:block;margin-top:5px;font-size:12px;color:#8190a8}.chevron{font-size:19px;color:#7285a4}#profile-form{padding:0 20px 20px;display:flex;flex-direction:column;gap:15px}label{display:flex;flex-direction:column;gap:7px;font-size:12px;color:#4b6082;min-width:0}input,select,textarea{width:100%;min-width:0;background:#fff;color:#223653;border:1px solid #dce3ef;border-radius:8px;padding:10px;font-size:13px}input::placeholder,textarea::placeholder{color:#99a5b7}textarea{resize:vertical}.two-cols,.scores{display:grid;grid-template-columns:1fr 1fr;gap:12px}.two-cols label{font-size:11px}.two-cols select{padding:10px 5px;font-size:12px}fieldset{border:0;padding:0;margin:2px 0}legend{font-size:13px;font-weight:700;padding:0;color:#263e65}.hint{font-size:11px;color:#8796ac;line-height:1.5;margin:5px 0 12px}.scores label{font-size:11px}.scores input{padding:9px 10px}.remember{display:flex;flex-direction:row;align-items:center;font-size:11px;line-height:1.4;color:#7586a0}.remember input{width:14px;height:14px;flex:none}.primary{width:100%;padding:13px}.primary:hover,.composer button:hover{background:#17347e}#profile-status{margin:0;text-align:center}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
@media(max-width:950px){.workspace{grid-template-columns:minmax(0,1fr) 310px;gap:16px;padding:20px}.topbar{padding:0 20px}h1{font-size:29px}#profile-form{padding:0 15px 18px}.portrait-panel summary{padding:18px 15px}.messages{padding:18px}.chat{height:calc(100dvh - 244px)}}
@media(max-width:720px){.topbar{height:62px;padding:0 16px}.brand img{width:32px;height:32px}.brand strong{font-size:19px}.topbar>a:last-child{font-size:11px}.workspace{display:flex;flex-direction:column;padding:18px 12px;gap:16px}.dialogue-column{display:contents}.intro{order:0;padding:0 4px}.eyebrow{display:none}h1{font-size:26px;margin:2px 0 10px}.intro>p{font-size:14px;margin:0}.portrait-panel{order:1;width:100%;border-radius:13px}.portrait-panel summary{padding:13px 16px}.portrait-panel summary strong{font-size:14px}.portrait-panel summary small{font-size:11px;margin-top:3px}.chat{order:2;width:100%;height:calc(100dvh - 125px);min-height:460px;border-radius:13px}.chat-heading{padding:12px 15px}.messages{padding:18px 14px}.message{gap:9px}.avatar{width:25px;height:25px;font-size:10px}.bubble{font-size:14px}.composer{margin:0 12px}.composer button{font-size:0;padding:10px 12px}.composer button span{font-size:22px;margin:0}.chat-foot{font-size:10px}.two-cols select{padding:10px;font-size:13px}}

/* Official MISIS logo and service credits. */
.brand img{width:132px;height:auto;display:block}.service-credit{padding:16px 12px 4px;text-align:center;color:#687993;font-size:12px;line-height:1.5}.service-credit p{margin:0}.service-credit p+p{margin-top:4px}
@media(max-width:720px){.brand img{width:112px;height:auto}.service-credit{order:3;width:100%;padding:0 8px 8px;font-size:11px}}

/* Fit the application to the viewport; scroll only messages and profile fields. */
html{height:100%;overflow:hidden}
body{height:100vh;height:100dvh;overflow:hidden;display:flex;flex-direction:column}
.topbar{height:64px;flex:0 0 64px}
.brand img{width:120px}
.workspace{width:100%;flex:1;min-height:0;padding:16px 24px 12px;gap:20px;align-items:stretch;overflow:hidden}
.dialogue-column{display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:12px;min-height:0}
.intro .eyebrow{display:none}
h1{font-size:28px;margin:0 0 6px;line-height:1.15}
.intro>p{font-size:14px;margin:0;line-height:1.4}
.chat{height:auto;min-height:0}
.chat-heading,.composer,.chat-foot,.waiting,.error{flex-shrink:0}
.chat-heading{padding:10px 16px}
.messages{min-height:0;padding:18px;gap:20px;scrollbar-gutter:stable}
.composer{margin:0 14px;padding:7px}
.composer textarea{max-height:min(120px,20dvh);resize:none}
.chat-foot{margin:8px 12px 10px}
.service-credit{padding:0 8px;font-size:11px;line-height:1.4}
.service-credit p+p{margin-top:2px}
.portrait-panel{height:100%;min-height:0}
#portrait{height:100%;min-height:0}
.portrait-panel summary{height:72px;padding:14px 16px}
#profile-form{height:calc(100% - 72px);min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:0 16px 16px;gap:12px}
@media(max-width:950px){.workspace{padding:12px 16px;gap:14px;grid-template-columns:minmax(0,1fr) 290px}h1{font-size:25px}}
@media(max-width:720px){
 .topbar{height:56px;flex-basis:56px;padding:0 14px}.brand img{width:102px}
 .workspace{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr) auto;padding:10px 12px;gap:10px}
 .dialogue-column{display:contents}
 .intro{grid-row:1;order:0;padding:0 2px}.intro h1{font-size:23px;margin:0 0 4px}.intro>p{font-size:12px}
 .portrait-panel{grid-row:2;order:initial;height:auto;max-height:38dvh}
 #portrait{height:auto}.portrait-panel summary{height:48px;padding:9px 14px}.portrait-panel summary small{margin-top:2px;font-size:10px}
 #profile-form{height:auto;max-height:calc(38dvh - 50px);padding:2px 14px 14px}
 .chat{grid-row:3;order:initial;height:auto;min-height:0}
 .messages{padding:14px 12px;gap:18px}.chat-heading{padding:8px 12px}
 .composer{margin:0 10px;padding:5px}.composer textarea{font-size:14px;line-height:1.4;max-height:80px}.composer button{padding:8px 12px}
 .chat-foot{margin:6px 8px 8px;font-size:9px}
 .service-credit{grid-row:4;order:initial;padding:0;font-size:10px;line-height:1.35}
 .workspace:has(#portrait[open]) .intro{display:none}
}
@media(max-height:600px){
 .topbar{height:48px;flex-basis:48px}.brand img{width:90px}
 .workspace{padding-top:8px;padding-bottom:8px;gap:8px}.dialogue-column{gap:8px}
 .intro h1{font-size:21px}.intro>p{display:none}
 .chat-heading{padding:6px 12px}.service-credit{font-size:10px}
}
/* Native details content does not resolve percentage heights consistently. */
.portrait-panel{position:relative}
#portrait[open] #profile-form{position:absolute;inset:72px 0 0;height:auto;max-height:none}
@media(max-width:720px){
 .portrait-panel:has(#portrait[open]){height:38dvh}
 #portrait[open] #profile-form{inset:48px 0 0;height:auto;max-height:none}
}
