:root{color-scheme:dark;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:#070e19;color:#eff5ff}
*{box-sizing:border-box}
body{margin:0;min-height:100dvh;background:radial-gradient(circle at 50% -20%,#173154 0%,#090f1b 55%,#070e19 100%)}
button,input,select,textarea{font:inherit}
button{cursor:pointer;touch-action:manipulation}
button:disabled{cursor:not-allowed;opacity:.42}
[hidden]{display:none!important}
.shell{max-width:900px;margin:auto;min-height:100dvh;display:flex;flex-direction:column;padding:0 16px}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:20px 4px 16px;border-bottom:1px solid #26394f}
.brand{display:flex;gap:12px;align-items:center}
.brand-mark{display:grid;place-items:center;width:46px;height:46px;border:1px solid #42bde1;border-radius:15px;color:#8de5ff;box-shadow:0 0 26px #158ab43b;font-size:28px;font-weight:750}
.brand strong{display:block;font-size:24px;letter-spacing:.3px}
.brand small{display:block;color:#a2b5c8;font-size:12px;margin-top:2px}
.top-actions{display:flex;align-items:center;gap:8px}
.status-pill{font-size:12px;color:#f9c98d;border:1px solid #755536;background:#3b2c26;border-radius:20px;padding:5px 10px;white-space:nowrap}
.status-pill.online{color:#8fead6;border-color:#286d64;background:#173b38}
.icon-button{display:grid;place-items:center;width:42px;height:42px;border:1px solid #32485e;background:#172439;border-radius:13px;color:#d2efff}
.toolbar{display:flex;gap:10px;padding:16px 0 12px}
.toolbar select{min-width:0;flex:1}
select,textarea,input[type=password]{border:1px solid #354d68;border-radius:12px;background:#131f30;color:#f2f7ff;padding:11px}
button:not(.icon-button){border:1px solid #3486a5;background:#147da5;color:#f8fdff;font-weight:650;border-radius:12px;padding:10px 15px}
button.secondary{background:#17283a;border-color:#40546a;color:#d5e4f2}
button:not(:disabled):hover{filter:brightness(1.12)}
.budget-strip{padding:3px 4px 14px;border-bottom:1px solid #26394f}
.budget-text{display:flex;justify-content:space-between;gap:10px;font-size:12px;color:#b2c5d7;margin-bottom:8px}
.budget-text strong{color:#dce9f5;font-variant-numeric:tabular-nums}
.budget-track{height:5px;border-radius:100px;background:#26384b;overflow:hidden}
.budget-fill{height:100%;width:0;background:#36badb;transition:width .3s}
.budget-fill.warning-level{background:#ffbd68}
.budget-fill.limit-level{background:#ff7b7b}
.messages{flex:1;min-height:240px;overflow:auto;display:flex;flex-direction:column;gap:14px;padding:24px 3px 32px;scroll-behavior:smooth}
.empty-state{margin:auto;max-width:390px;text-align:center;color:#a8bfd4;padding:18px}
.empty-state h1{color:#eff5ff;font-size:25px;margin:16px 0 12px}
.empty-state p{line-height:1.55;font-size:14px}
.orb{display:grid;place-items:center;width:92px;height:92px;border-radius:50%;margin:auto;background:radial-gradient(circle,#45d0f29c,#145b8544 55%,#10334e2d);border:1px solid #348eb8;font-size:45px;color:#9bf1ff;box-shadow:0 0 60px #1f9bcc36}
.message{padding:13px 16px;border:1px solid #2b4259;border-radius:17px;max-width:85%;line-height:1.55;font-size:15px;white-space:pre-wrap;overflow-wrap:anywhere}
.message.assistant{align-self:flex-start;background:#15243a}
.message.user{align-self:flex-end;background:#123b4a;border-color:#226f81}
.message .role{display:block;font-size:11px;letter-spacing:.5px;text-transform:uppercase;color:#89aeca;margin-bottom:6px}
.message.user .role{color:#8ad6db}
.notice{margin:0 0 8px;padding:9px 12px;border:1px solid #815441;background:#372825;color:#ffcdad;border-radius:10px;font-size:13px}
.warning{margin-top:12px;padding:13px 15px;border:1px solid #aa7d43;background:#372c20;border-radius:13px;color:#ffe2a6}
.warning p{margin:0 0 12px;font-size:14px;line-height:1.5}
.composer{display:flex;align-items:end;gap:10px;background:#111d2d;border:1px solid #314960;border-radius:18px;padding:10px;margin-bottom:8px}
.composer textarea{flex:1;min-width:0;resize:none;min-height:44px;max-height:140px;background:transparent;border:0;padding:10px 5px;outline:none}
.composer button{min-height:44px}
.mic-button.active{border-color:#e58872;background:#6e3735;box-shadow:0 0 0 4px #e5887222}
footer{text-align:center;font-size:11px;color:#7790a9;padding:5px 0 17px}
.modal{border:1px solid #395a76;color:#eef5ff;background:#101e2f;border-radius:20px;width:min(94vw,440px);padding:25px;box-shadow:0 20px 90px #000b}
.modal::backdrop{background:#030914cf;backdrop-filter:blur(6px)}
.modal h2{margin:0 0 12px}
.modal p{color:#adbecd;font-size:14px;line-height:1.6}
.modal label{display:block;font-size:13px;margin:14px 0 7px}
.modal input[type=password]{width:100%;font-size:15px}
.modal .toggle-row{display:flex;gap:10px;align-items:center}
.modal .toggle-row input{width:18px;height:18px}
.dialog-actions{display:flex;justify-content:space-between;gap:8px;margin-top:22px}
#loginNotice{color:#ffbb97;min-height:18px}
.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}
@media(max-width:520px){
 .shell{padding:0 12px}
 .topbar{padding-top:max(16px,env(safe-area-inset-top))}
 .brand strong{font-size:21px}
 .brand-mark{width:41px;height:41px}
 .status-pill{font-size:10px;padding:5px 7px}
 .toolbar{padding-top:12px}
 .toolbar button{padding:10px!important;font-size:12px}
 .messages{padding:15px 0;gap:11px}
 .message{max-width:92%;font-size:14px}
 .composer{gap:5px;padding:6px}
 .composer button:not(.icon-button){padding:8px 11px;font-size:13px}
 footer{font-size:10px}
}
