:root{color-scheme:dark;font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;background:#10141b;color:#eef0f5;font-synthesis:none}
*{box-sizing:border-box}
html{min-height:100%;scroll-behavior:smooth}
body{margin:0;min-height:100vh;background:radial-gradient(ellipse at 80% 9%,#1d2b42 0,transparent 38%),#10141b;display:flex;flex-direction:column}
button,input{font:inherit}
button{cursor:pointer}
button:disabled{opacity:.6;cursor:wait}
[hidden]{display:none!important}
.brandbar{height:82px;display:flex;gap:24px;align-items:center;border-bottom:1px solid #28303f;padding:0 clamp(18px,5vw,86px)}
.logo{text-decoration:none;letter-spacing:-.075em;font-family:Georgia,serif;font-size:34px;font-weight:700;color:#f5f2e8}
.logo span{color:#8faed9}
.brandbar-note{letter-spacing:.16em;font-size:10px;font-weight:800;color:#93a2bb}
.shell{width:100%;max-width:1150px;margin:auto;flex:1;padding:64px 24px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px}
.card{width:min(100%,462px);background:#191f29;border:1px solid #364052;border-radius:18px;padding:clamp(24px,5vw,42px);box-shadow:0 28px 75px #0004}
.card h1,.dashboard h1{font-family:Georgia,serif;font-size:clamp(32px,4vw,43px);line-height:1.12;letter-spacing:-.035em;margin:9px 0 16px}
.eyebrow{color:#94b7ec;font-size:11px;letter-spacing:.14em;font-weight:800}
.description{color:#aeb9c8;font-size:14px;line-height:1.75;margin:0 0 22px}
label{display:block;font-size:13px;font-weight:600;margin:19px 0 8px;color:#d8deea}
input{width:100%;border:1px solid #48556a;border-radius:9px;color:#f7f9ff;background:#111720;outline:0;padding:14px 15px;transition:border-color .15s,box-shadow .15s}
input:focus{border-color:#8aaddf;box-shadow:0 0 0 3px #6596dc2c}
.primary{border:0;width:100%;background:#a4bde3;border-radius:9px;color:#141c2a;font-size:14px;font-weight:750;padding:14px 22px;margin-top:26px;min-height:48px;display:flex;justify-content:center;align-items:center;gap:12px}
.primary:not(:disabled):hover{background:#c2d2ed}
.primary .button-loader{display:none;width:14px;height:14px;border:2px solid #10151e66;border-top-color:#10151e;border-radius:50%;animation:spin 1s linear infinite}
.primary:disabled .button-loader{display:block}
.loader{height:28px;width:28px;margin:0 auto 17px;border-radius:50%;border:3px solid #a0b5d444;border-top-color:#a7c4f2;animation:spin 1s linear infinite}
#loadingStage{text-align:center;color:#aeb9c8;font-size:14px}
@keyframes spin{to{transform:rotate(360deg)}}
.link-button{padding:0;background:none;color:#b4c9eb;text-decoration:underline;text-underline-offset:3px;border:0;margin-top:25px}
.qr-wrap{margin:24px auto;background:#fff;border-radius:12px;width:max-content;padding:16px;max-width:100%}
.qr-wrap img{display:block;max-width:100%;object-fit:contain}
.message{max-width:660px;width:100%;padding:15px 20px;background:#382324;border:1px solid #874b51;color:#ffdce1;border-radius:10px;line-height:1.5;margin:0}
.dashboard{width:100%}
.dashboard-heading{display:flex;justify-content:space-between;align-items:start;gap:20px;margin-bottom:32px}
.outline{background:transparent;color:#dee7f4;border:1px solid #49556b;border-radius:8px;padding:12px 16px}
.outline:hover{background:#252d3a}
.dashboard-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:18px}
.metric-card,.next-box{background:#191f29;border:1px solid #344052;border-radius:13px;padding:26px}
.metric-card p{color:#abb9cf;margin:0 0 8px;font-size:13px}
.metric-card strong{font-family:Georgia,serif;display:block;font-size:48px;font-weight:500;margin-bottom:8px;color:#f0f3f9}
.metric-card small{color:#93a1b7;line-height:1.5;display:block}
.next-box h2{font-family:Georgia,serif;font-size:25px;margin:12px 0}
.next-box p:last-child{color:#afbdd1;font-size:14px;line-height:1.8;margin-bottom:0}
.footer{padding:22px;text-align:center;border-top:1px solid #27303b;font-size:12px;color:#738399}
@media(max-width:650px){.brandbar{height:72px}.shell{padding:34px 14px}.dashboard-grid{grid-template-columns:1fr}.dashboard-heading{flex-direction:column}.metric-card{padding:18px}.card{padding:24px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

.agent-status{padding:14px 0;color:#aabbd3;font-size:13px}.agent-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:16px}.agent-card{border:1px solid #3a475d;border-radius:10px;padding:18px;background:#131a26}.agent-card h3{font-size:17px;margin:0 0 7px}.agent-card p{color:#aabbd3;font-size:13px;line-height:1.5;margin:0 0 13px}.agent-card label{margin:12px 0 7px;font-size:12px}.agent-card select{width:100%;padding:10px 12px;border:1px solid #4a5972;border-radius:8px;background:#101723;color:#f1f5fc;font:inherit;outline-offset:3px}.agent-card button{width:100%;margin-top:14px;padding:10px;border-radius:8px;color:#0e1726;background:#b0c7e9;border:0;font-weight:700;min-height:42px}.agent-card button:disabled{opacity:.6}.agent-card .agent-feedback{font-size:12px;margin:8px 0 0;min-height:18px}.agent-card .role{color:#a2b9df}.agent-list .meta{font-size:12px;color:#94a4ba}@media(max-width:700px){.agent-list{grid-template-columns:1fr}}
.chat-panel{width:100%;margin-top:28px;border:1px solid #36445a;border-radius:14px;background:#191f29;padding:clamp(18px,4vw,28px)}
.chat-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.chat-heading h2{font-family:Georgia,serif;font-size:clamp(24px,4vw,33px);margin:6px 0 10px}
.chat-messages{display:flex;flex-direction:column;gap:13px;min-height:190px;max-height:420px;overflow:auto;padding:16px 4px;border-block:1px solid #334052}
.chat-bubble{padding:13px 16px;border-radius:12px;max-width:min(88%,660px);white-space:pre-wrap;overflow-wrap:anywhere}
.chat-bubble p{margin:8px 0 0;font-size:14px;line-height:1.75}
.chat-user{align-self:flex-end;background:#2d4565;color:#f6f8ff}
.chat-agent{align-self:flex-start;background:#222e3e;color:#ecf1fb}
.chat-speaker{font-size:11px;color:#bcd0e9}
.chat-status{font-size:13px;min-height:20px;color:#adc1db}
.chat-empty{font-size:14px;color:#aebbd0}
.chat-form label{margin:8px 0}
.chat-form textarea{width:100%;min-height:92px;resize:vertical;padding:12px 15px;border:1px solid #48556a;border-radius:9px;color:#f7f9ff;background:#111720;font:inherit;line-height:1.6}
.chat-form textarea:focus{outline:2px solid #7199c9;outline-offset:2px}
.chat-form .primary{margin-top:10px;max-width:200px}
.agent-card .agent-secondary{background:transparent;color:#d4e5fb;border:1px solid #526a88;margin-top:10px}
.agent-card .agent-secondary:hover{background:#293a50}
.agent-specialty{font-weight:700;color:#c3d7f1!important}
.agent-bio{font-size:12px!important;color:#c0cbdb!important}
@media(max-width:650px){.chat-panel{padding:15px}.chat-bubble{max-width:96%}.chat-form .primary{max-width:none}}

.profile-actions{display:flex;gap:10px;flex-wrap:wrap;margin:16px 0}
.profile-actions button{flex:1;min-width:170px}
.profile-form input,.profile-form textarea,#profileJson,#profileDraftSelect{width:100%;background:#111720;color:#f7f9ff;border:1px solid #48556a;border-radius:9px;padding:13px 14px;font:inherit}
.profile-form textarea,#profileJson{resize:vertical;line-height:1.5}
#profilePanel{margin-top:18px}
#profilePanel select{min-height:45px}
#profilePanel label{color:#d8deea}
#profilePanel button:disabled{opacity:.5;cursor:wait}

.agent-avatar{width:88px;height:88px;object-fit:cover;object-position:center;border-radius:50%;border:2px solid #5d7496;float:right;margin:0 0 12px 14px}
.agent-card{overflow:hidden}
.agent-card .agent-danger{background:transparent;color:#efbdc1;border:1px solid #86545c}
.agent-card .agent-danger:hover{background:#3c242f}
.portrait-tools{margin:24px 0;padding:19px;border:1px solid #495873;border-radius:12px;background:#131a26}
.portrait-tools h3{font-family:Georgia,serif;font-weight:500;font-size:21px;margin:0 0 14px}
.portrait-preview-wrap{display:flex;justify-content:flex-start}
#portraitPreview{width:172px;height:172px;object-fit:cover;border-radius:12px;border:1px solid #566987;margin-bottom:16px}
#portraitFile{display:block;max-width:100%;padding:14px 12px}
#portraitUpload{margin-top:15px}
#portraitStatus{margin:12px 0 0}
