:root{
  color-scheme:dark;
  --bg:#080a13;--panel:#101321;--panel-strong:#15192a;--panel-soft:#0d101c;
  --text:#f6f7ff;--muted:#969eb7;--muted2:#69728c;--line:rgba(255,255,255,.085);
  --purple:#8b5cf6;--purple2:#6435d4;--cyan:#31d7f3;--green:#28d49f;
  --gold:#f2bd55;--danger:#ff7188;--shadow:0 24px 80px rgba(0,0,0,.34);
  font-family:Tahoma,"Segoe UI",Arial,sans-serif
}
*{box-sizing:border-box}
html,body{width:100%;height:100%;margin:0;background:var(--bg);color:var(--text)}
body{overflow:hidden}
button,input,textarea{font:inherit}
button{touch-action:manipulation}
.hidden{display:none!important}
.ambient{position:fixed;border-radius:50%;filter:blur(110px);opacity:.14;pointer-events:none}
.ambient-a{width:420px;height:420px;background:#713af4;right:-180px;top:-190px}
.ambient-b{width:360px;height:360px;background:#10bfdc;left:-170px;bottom:-170px}

.app-shell{position:relative;z-index:1;width:min(1440px,100%);height:100vh;height:100dvh;margin:auto;display:flex;flex-direction:column;overflow:hidden}
.topbar{height:70px;flex:0 0 70px;padding:0 24px;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;border-bottom:1px solid var(--line);background:rgba(8,10,19,.8);backdrop-filter:blur(18px)}
.brand{justify-self:start;display:flex;direction:ltr;align-items:center;gap:10px;color:inherit;text-decoration:none}
.brand-mark,.welcome-logo,.auth-logo,.mini-z{display:grid;place-items:center;background:linear-gradient(145deg,#a075ff,#5a29c8);color:#fff;font-weight:900;box-shadow:0 10px 28px rgba(105,57,222,.35)}
.brand-mark{width:39px;height:39px;border-radius:13px;font-size:21px;font-family:Arial,sans-serif;font-style:italic}
.brand-copy{display:flex;flex-direction:column}
.brand-copy strong{font-size:18px;line-height:1;letter-spacing:2px}
.brand-copy small{font-size:7px;margin-top:5px;color:#8e96ae;letter-spacing:1.6px}
.top-title{display:flex;align-items:center;gap:9px;text-align:right}
.top-title>span:last-child{display:flex;flex-direction:column;gap:2px}
.top-title b{font-size:13px}.top-title small{font-size:9px;color:var(--muted)}
.online-dot{width:8px;height:8px;border-radius:50%;background:var(--green);box-shadow:0 0 12px var(--green)}
.top-actions{justify-self:end;display:flex;align-items:center;gap:9px}
.usage-badge{white-space:nowrap;padding:8px 11px;border:1px solid var(--line);background:rgba(255,255,255,.035);border-radius:11px;font-size:10px;color:#aeb5ca}
.usage-badge b{color:#fff}
.account-button{height:40px;border:1px solid rgba(139,92,246,.4);background:rgba(139,92,246,.12);color:#eee7ff;border-radius:12px;padding:0 14px;display:flex;align-items:center;gap:8px;cursor:pointer;transition:.2s}
.account-button:hover{background:rgba(139,92,246,.2);border-color:rgba(165,128,255,.55)}
.user-icon{width:20px;height:20px;border-radius:8px;display:grid;place-items:center;background:linear-gradient(145deg,#9568f7,#6030cd);color:#fff;font-size:7px}

.workspace{flex:1;min-height:0;display:grid;grid-template-columns:265px minmax(0,1fr);gap:14px;padding:14px 18px 18px}
.side-panel,.chat-panel{min-height:0;background:linear-gradient(145deg,rgba(17,20,35,.97),rgba(11,14,25,.97));border:1px solid var(--line);border-radius:20px;box-shadow:var(--shadow)}
.side-panel{padding:14px;display:flex;flex-direction:column;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#34394f transparent}
.new-chat{width:100%;min-height:45px;border:1px solid rgba(139,92,246,.26);background:rgba(139,92,246,.09);color:#eee9ff;border-radius:13px;text-align:right;padding:0 14px;cursor:pointer;font-size:12px;transition:.2s}
.new-chat:hover{background:rgba(139,92,246,.16)}.new-chat span{font-size:18px;vertical-align:-1px;margin-left:7px}
.side-heading{font-size:9px;color:#727b94;padding:18px 7px 9px}
.side-tool{width:100%;border:1px solid transparent;background:transparent;color:inherit;border-radius:13px;padding:8px;display:flex;align-items:center;gap:10px;text-align:right;cursor:pointer;transition:.18s}
.side-tool:hover{background:rgba(255,255,255,.047);border-color:var(--line)}
.side-tool>span:last-child,.tool-menu button>span:last-child{min-width:0;display:flex;flex-direction:column;gap:3px}
.side-tool b,.tool-menu button b{font-size:11px;font-weight:700}.side-tool small,.tool-menu button small{font-size:8px;color:var(--muted)}
.tool-icon{width:34px;height:34px;flex:0 0 34px;border-radius:11px;display:grid;place-items:center;font-size:15px;font-weight:800}
.tool-icon.violet{color:#bda5ff;background:rgba(139,92,246,.14)}
.tool-icon.cyan{color:#66e5f8;background:rgba(49,215,243,.12)}
.tool-icon.pink{color:#ff91b9;background:rgba(255,103,158,.12)}
.tool-icon.green{color:#52e1b5;background:rgba(40,212,159,.12)}
.tool-icon.gold{color:#ffd270;background:rgba(242,189,85,.12)}
.tool-icon.blue{color:#8eb8ff;background:rgba(94,144,255,.13)}
.side-footer{margin-top:auto;padding:15px 8px 4px;border-top:1px solid var(--line);display:flex;align-items:flex-start;gap:9px}
.mini-z{width:25px;height:25px;flex:0 0 25px;border-radius:8px;font:800 12px Arial}
.side-footer p{margin:0;color:#6f7890;font-size:8px;line-height:1.8}

.chat-panel{display:flex;flex-direction:column;overflow:hidden}
.chat-head{height:61px;flex:0 0 61px;padding:0 18px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);background:rgba(255,255,255,.012)}
.chat-agent{display:flex;align-items:center;gap:9px;direction:ltr;text-align:left}
.agent-avatar{width:34px;height:34px;border-radius:11px;background:linear-gradient(145deg,#9466f8,#5b2bc7);display:grid;place-items:center;font:900 17px Arial;box-shadow:0 8px 20px rgba(102,53,213,.27)}
.chat-agent>span:last-child{display:flex;flex-direction:column;gap:3px}.chat-agent b{font-size:12px;letter-spacing:.4px}.chat-agent small{font-size:8px;color:var(--muted)}.chat-agent small i{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--green);margin-right:3px}
.ghost-button{height:35px;border:1px solid var(--line);background:rgba(255,255,255,.025);border-radius:11px;color:#98a0b8;padding:0 11px;cursor:pointer;font-size:9px;display:flex;align-items:center;gap:4px}.ghost-button:hover{color:#fff;background:rgba(255,255,255,.055)}.ghost-button span:first-child{font-size:15px}

.messages{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scroll-behavior:smooth;padding:26px clamp(16px,4vw,58px);scrollbar-width:thin;scrollbar-color:#34394f transparent}
.messages::-webkit-scrollbar,.side-panel::-webkit-scrollbar{width:7px}.messages::-webkit-scrollbar-thumb,.side-panel::-webkit-scrollbar-thumb{background:#34394f;border-radius:20px}
.welcome{min-height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:20px 0 28px}
.welcome-logo{width:62px;height:62px;border-radius:20px;font:italic 900 31px Arial;margin-bottom:18px}
.welcome h1{font-size:clamp(24px,3vw,36px);margin:0 0 9px}.welcome h1 em{font-style:normal;background:linear-gradient(90deg,#aa84ff,#4bddf2);background-clip:text;color:transparent}
.welcome>p{max-width:520px;margin:0;color:var(--muted);font-size:12px;line-height:1.9}
.suggestions{width:min(660px,100%);display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:28px}
.suggestions button{min-height:70px;border:1px solid var(--line);background:rgba(255,255,255,.03);border-radius:15px;color:inherit;padding:13px 15px;text-align:right;display:flex;flex-direction:column;gap:5px;cursor:pointer;transition:.2s}
.suggestions button:hover{border-color:rgba(139,92,246,.35);background:rgba(139,92,246,.07);transform:translateY(-1px)}
.suggestions b{font-size:11px}.suggestions small{font-size:9px;color:var(--muted)}

.message{width:100%;display:flex;align-items:flex-start;gap:9px;direction:ltr;margin:0 auto 19px}
.message.ai-message{justify-content:flex-start}.message.user-message{justify-content:flex-start;flex-direction:row-reverse}
.avatar{width:31px;height:31px;flex:0 0 31px;border-radius:10px;display:grid;place-items:center;font:800 12px Arial;color:#fff;background:linear-gradient(145deg,#8c5af1,#5125b7)}
.user-message .avatar{background:#252a3b;color:#bfc6da;font-family:Tahoma,Arial}
.message-content{max-width:min(78%,760px);min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:5px}
.user-message .message-content{align-items:flex-end}
.bubble{direction:rtl;text-align:right;max-width:100%;background:rgba(255,255,255,.052);border:1px solid var(--line);border-radius:5px 16px 16px 16px;padding:12px 15px;color:#eef0fa;font-size:12px;line-height:1.95;white-space:pre-wrap;overflow-wrap:anywhere;box-shadow:0 8px 24px rgba(0,0,0,.08)}
.user-message .bubble{background:linear-gradient(145deg,rgba(124,79,226,.93),rgba(88,52,171,.93));border-color:transparent;border-radius:16px 5px 16px 16px;color:#fff}
.message-image{display:block;width:min(300px,100%);max-height:260px;object-fit:cover;border-radius:13px;margin-bottom:9px;border:1px solid rgba(255,255,255,.14)}
.message-meta{direction:rtl;color:#5f6880;font-size:8px;display:flex;gap:7px;align-items:center;padding:0 3px}
.copy-button{border:0;background:none;color:#737d97;padding:0;cursor:pointer;font-size:8px}.copy-button:hover{color:#c3b4ec}
.typing{display:flex;direction:ltr;gap:4px;padding:5px}.typing i{width:6px;height:6px;border-radius:50%;background:#ad9dd0;animation:blink 1.1s infinite}.typing i:nth-child(2){animation-delay:.15s}.typing i:nth-child(3){animation-delay:.3s}
@keyframes blink{0%,70%,100%{opacity:.25;transform:translateY(0)}35%{opacity:1;transform:translateY(-3px)}}

.composer-zone{position:relative;flex:0 0 auto;padding:8px clamp(12px,3.2vw,45px) 10px;background:linear-gradient(0deg,#0b0e19 72%,rgba(11,14,25,0));z-index:4}
.composer{width:min(900px,100%);min-height:56px;margin:auto;border:1px solid rgba(139,92,246,.27);background:#111522;border-radius:19px;display:flex;align-items:flex-end;gap:7px;padding:7px;box-shadow:0 0 0 3px rgba(139,92,246,.035),0 14px 35px rgba(0,0,0,.2)}
.composer:focus-within{border-color:rgba(156,112,255,.52);box-shadow:0 0 0 3px rgba(139,92,246,.07),0 14px 35px rgba(0,0,0,.22)}
.composer textarea{flex:1;min-width:0;min-height:40px;max-height:130px;resize:none;border:0;outline:0;background:transparent;color:#f7f8ff;padding:10px 5px;font-size:12px;line-height:1.65;overflow-y:auto}.composer textarea::placeholder{color:#68718a}
.plus-button,.send-button{width:41px;height:41px;flex:0 0 41px;border:0;border-radius:13px;display:grid;place-items:center;cursor:pointer}
.plus-button{background:rgba(255,255,255,.055);color:#c2c8d9;font-size:23px;transition:.2s}.plus-button:hover,.plus-button.active{background:rgba(139,92,246,.16);color:#cdbdff;transform:rotate(45deg)}
.send-button{background:linear-gradient(145deg,#9363f9,#6333d3);box-shadow:0 8px 19px rgba(99,51,211,.3)}.send-button:disabled{opacity:.45;cursor:not-allowed}.send-button svg{width:18px;fill:none;stroke:#fff;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;transform:rotate(180deg)}
.composer-foot{min-height:18px;display:flex;justify-content:center;align-items:center;gap:5px;color:#5f687f;font-size:8px;padding-top:6px;text-align:center}
.attachment-preview{width:min(900px,100%);height:58px;margin:0 auto 7px;padding:6px 8px;border:1px solid rgba(139,92,246,.24);background:#131726;border-radius:15px;display:flex;align-items:center;gap:9px;box-shadow:0 10px 30px rgba(0,0,0,.2)}
.attachment-preview img{width:45px;height:45px;object-fit:cover;border-radius:10px}.attachment-preview>span{min-width:0;display:flex;flex:1;flex-direction:column;gap:4px}.attachment-preview b{font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.attachment-preview small{font-size:8px;color:var(--muted)}.attachment-preview button{width:28px;height:28px;border:0;border-radius:9px;background:rgba(255,255,255,.05);color:#9ea6bb;cursor:pointer;font-size:18px}
.tool-menu{position:absolute;right:clamp(12px,3.2vw,45px);bottom:88px;width:min(460px,calc(100% - 24px));max-height:min(510px,70vh);overflow-y:auto;display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:10px;background:rgba(20,24,40,.98);border:1px solid rgba(255,255,255,.1);border-radius:18px;box-shadow:0 25px 80px rgba(0,0,0,.55);backdrop-filter:blur(18px);animation:menuIn .16s ease-out}
@keyframes menuIn{from{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}
.tool-menu-title{grid-column:1/-1;padding:5px 6px 8px;display:flex;flex-direction:column;gap:3px}.tool-menu-title b{font-size:12px}.tool-menu-title small{font-size:8px;color:var(--muted)}
.tool-menu button{border:1px solid transparent;background:rgba(255,255,255,.03);color:inherit;border-radius:13px;padding:8px;display:flex;align-items:center;gap:8px;text-align:right;cursor:pointer}.tool-menu button:hover{border-color:rgba(139,92,246,.28);background:rgba(139,92,246,.08)}

.modal{position:fixed;inset:0;z-index:50;display:grid;place-items:center;padding:18px;overflow-y:auto}
.modal-backdrop{position:absolute;inset:0;background:rgba(3,4,10,.78);backdrop-filter:blur(9px)}
.modal-card{position:relative;width:min(440px,100%);max-height:calc(100vh - 30px);overflow-y:auto;background:linear-gradient(145deg,#181c2f,#0d101d);border:1px solid rgba(255,255,255,.11);border-radius:24px;padding:28px;box-shadow:0 32px 110px #000;animation:modalIn .18s ease-out}
@keyframes modalIn{from{opacity:0;transform:translateY(12px) scale(.98)}to{opacity:1;transform:none}}
.close-button{position:absolute;left:14px;top:12px;width:34px;height:34px;border:0;border-radius:10px;background:rgba(255,255,255,.03);color:#949cb2;font-size:22px;cursor:pointer}
.auth-card{text-align:center}.auth-logo{width:54px;height:54px;margin:0 auto 12px;border-radius:17px;font:italic 900 25px Arial}.modal-kicker{font-size:8px;color:#a98afa;background:rgba(139,92,246,.1);border:1px solid rgba(139,92,246,.18);border-radius:20px;padding:5px 9px}.auth-card h2{font-size:22px;margin:13px 0 7px}.auth-card>p{color:var(--muted);font-size:10px;margin:0 0 19px}.auth-card label{display:block;text-align:right;font-size:9px;color:#aeb5ca;margin:11px 0}.auth-card input{display:block;width:100%;margin-top:7px;border:1px solid var(--line);background:#0a0d18;color:#fff;padding:13px;border-radius:12px;outline:0;font-size:12px}.auth-card input:focus{border-color:#7851d7;box-shadow:0 0 0 3px rgba(118,80,212,.1)}.code-input{text-align:center!important;direction:ltr;font-size:21px!important;letter-spacing:7px!important}
.primary-button{width:100%;border:0;border-radius:13px;padding:13px;background:linear-gradient(145deg,#9161f8,#6232d2);color:#fff;font-size:11px;font-weight:bold;cursor:pointer;margin-top:8px}.text-button{border:0;background:none;color:#ad8dff;font-size:9px;margin-top:13px;cursor:pointer}.auth-status{min-height:19px;margin-top:11px;font-size:9px;color:#54dbad}.auth-status.error{color:var(--danger)}.privacy{display:block;color:#697189;font-size:8px;line-height:1.8;margin-top:11px}

.account-header{display:flex;align-items:center;gap:11px;margin-bottom:15px}.account-avatar{width:47px;height:47px;border-radius:15px;background:linear-gradient(145deg,#9667f9,#5b2ac8);display:grid;place-items:center;font:italic 900 22px Arial}.account-header>span:last-child{display:flex;flex-direction:column;gap:3px}.account-header small{font-size:8px;color:var(--muted)}.account-header h2{font-size:17px;margin:0}
.identity-box{background:rgba(255,255,255,.03);border:1px solid var(--line);border-radius:14px;padding:12px;margin-bottom:9px}.identity-box b,.identity-box small{display:block}.identity-box b{font-size:12px}.identity-box small{direction:ltr;text-align:right;color:var(--muted);font-size:9px;margin-top:5px;overflow:hidden;text-overflow:ellipsis}
.plan-box{display:flex;justify-content:space-between;align-items:center;background:linear-gradient(135deg,rgba(139,92,246,.14),rgba(49,215,243,.055));border:1px solid rgba(139,92,246,.2);border-radius:14px;padding:12px}.plan-box>span:first-child{display:flex;flex-direction:column;gap:4px}.plan-box small{font-size:8px;color:var(--muted)}.plan-box strong{font-size:13px}.plan-pill{font:800 8px Arial;letter-spacing:1px;color:#d8c9ff;background:rgba(139,92,246,.18);border:1px solid rgba(139,92,246,.25);padding:6px 8px;border-radius:8px}
.usage-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:9px 0}.usage-grid>div{background:rgba(255,255,255,.025);border:1px solid var(--line);border-radius:13px;padding:11px}.usage-grid small,.usage-grid b{display:block}.usage-grid small{font-size:8px;color:var(--muted)}.usage-grid b{font-size:10px;margin:7px 0}.progress{display:block;height:4px;background:#252a3b;border-radius:10px;overflow:hidden}.progress i{display:block;width:0;height:100%;border-radius:10px;background:linear-gradient(90deg,#7041db,#a77dff);transition:.3s}
.expiry-row{display:flex;justify-content:space-between;padding:11px 2px;font-size:9px;color:var(--muted)}.expiry-row b{color:#c9cede}.upgrade-button{height:45px;border-radius:13px;background:linear-gradient(145deg,#8d5df4,#6232d2);color:#fff;text-decoration:none;display:flex;align-items:center;justify-content:space-between;padding:0 15px;font-size:10px;font-weight:bold;box-shadow:0 10px 25px rgba(98,50,210,.25)}.support-note{font-size:8px;line-height:1.8;color:#737c94;text-align:center}.support-note b{color:#a990ee}.logout-button{width:100%;border:0;border-top:1px solid var(--line);background:none;color:#ff8296;padding:12px 0 0;margin-top:4px;font-size:9px;cursor:pointer}
.toast{position:fixed;z-index:80;left:50%;bottom:22px;transform:translateX(-50%);max-width:min(420px,calc(100% - 30px));background:#202538;border:1px solid rgba(255,255,255,.12);border-radius:12px;padding:10px 15px;color:#eef0f8;font-size:9px;box-shadow:0 15px 50px #000;animation:menuIn .16s ease-out}

@media(max-width:920px){
  .topbar{grid-template-columns:1fr auto;padding:0 15px}.top-title{display:none}.workspace{grid-template-columns:1fr;padding:10px}.side-panel{display:none}.chat-panel{border-radius:18px}.messages{padding-inline:18px}.top-actions{gap:6px}
}
@media(max-width:600px){
  .app-shell{width:100%}.topbar{height:60px;flex-basis:60px;padding:0 10px}.brand-mark{width:34px;height:34px;border-radius:11px;font-size:18px}.brand-copy strong{font-size:15px}.brand-copy small{display:none}.usage-badge{display:none}.account-button{height:36px;padding:0 9px;font-size:9px}.user-icon{width:18px;height:18px}
  .workspace{padding:0}.chat-panel{border:0;border-radius:0;box-shadow:none}.chat-head{height:53px;flex-basis:53px;padding:0 12px}.agent-avatar{width:31px;height:31px}.ghost-button span:last-child{display:none}.ghost-button{width:34px;padding:0;justify-content:center}
  .messages{padding:18px 11px}.welcome{justify-content:flex-start;padding-top:8vh}.welcome-logo{width:54px;height:54px;border-radius:17px;font-size:27px}.welcome h1{font-size:24px}.welcome>p{font-size:10px;padding:0 12px}.suggestions{grid-template-columns:1fr 1fr;margin-top:21px;gap:7px}.suggestions button{min-height:63px;padding:10px}.suggestions b{font-size:9px}.suggestions small{font-size:8px}
  .message{gap:7px;margin-bottom:15px}.avatar{width:28px;height:28px;flex-basis:28px}.message-content{max-width:86%}.bubble{font-size:11px;padding:10px 12px;line-height:1.85}.message-image{max-height:220px}
  .composer-zone{padding:7px 8px 6px}.composer{min-height:52px;border-radius:17px;padding:5px}.plus-button,.send-button{width:40px;height:40px;flex-basis:40px}.composer textarea{font-size:11px;padding-inline:3px}.composer-foot{font-size:7px}.composer-foot span:nth-child(2),.composer-foot span:nth-child(3){display:none}
  .tool-menu{right:8px;bottom:75px;width:calc(100% - 16px);grid-template-columns:1fr 1fr;padding:8px}.tool-menu button{padding:7px}.tool-menu button small{display:none}.tool-menu .tool-icon{width:31px;height:31px;flex-basis:31px}.attachment-preview{height:54px}
  .modal{padding:10px}.modal-card{padding:24px 18px;border-radius:21px}.usage-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:370px){.suggestions{grid-template-columns:1fr}.suggestions button{min-height:55px}.tool-menu{grid-template-columns:1fr}.tool-menu-title{grid-column:1}.account-button #accountButtonText{max-width:88px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
