*{box-sizing:border-box;margin:0;padding:0}
:root{
 --bg:#080a18;--bg2:#101535;--panel:rgba(14,18,42,.78);--solid:#111633;
 --hover:#191f47;--border:rgba(255,255,255,.1);--border2:rgba(255,255,255,.18);
 --text:#f8f9ff;--muted:#aab1cc;--bubble:#171d3d;--input:rgba(17,22,50,.9);
}
body.light{
 --bg:#f4f6ff;--bg2:#fff;--panel:rgba(255,255,255,.8);--solid:#fff;
 --hover:#eef1ff;--border:rgba(30,40,90,.1);--border2:rgba(30,40,90,.18);
 --text:#151a32;--muted:#68718b;--bubble:#edf0fb;--input:rgba(255,255,255,.94)
}
html,body{height:100%;overflow:hidden}
body{
 font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;color:var(--text);
 background:radial-gradient(circle at 10% 10%,#7c4dff38,transparent 27%),
 radial-gradient(circle at 90% 15%,#20c9ff30,transparent 25%),
 radial-gradient(circle at 80% 90%,#ff4fc428,transparent 27%),
 linear-gradient(135deg,var(--bg),var(--bg2));transition:.3s
}
button,textarea,input{font:inherit}button{border:0;color:inherit;cursor:pointer}
.bg-orbs{position:fixed;inset:0;overflow:hidden;pointer-events:none;z-index:-1}
.orb{position:absolute;width:300px;height:300px;border-radius:50%;filter:blur(70px);opacity:.15;animation:float 13s ease-in-out infinite alternate}
.orb-1{background:#7c4dff;left:-100px;top:10%}.orb-2{background:#20c9ff;right:-100px;top:15%;animation-delay:-3s}
.orb-3{background:#ff4fc4;right:15%;bottom:-170px;animation-delay:-6s}.orb-4{background:#ffad42;left:30%;bottom:-190px;animation-delay:-9s}
@keyframes float{to{transform:translate(35px,-25px) scale(1.12)}}
.app{height:100dvh;display:flex}.sidebar{
 width:290px;flex:0 0 290px;padding:18px;display:flex;flex-direction:column;
 background:var(--panel);backdrop-filter:blur(28px);border-right:1px solid var(--border);z-index:20
}
.brand{display:flex;gap:12px;align-items:center;margin-bottom:20px}.brand-logo,.modal-icon{
 display:grid;place-items:center;color:#fff;background:linear-gradient(135deg,#7c4dff,#20c9ff 50%,#ff4fc4);
 box-shadow:0 12px 35px #7c4dff45
}.brand-logo{width:42px;height:42px;border-radius:14px;font-size:20px}
.brand b{display:block;font-size:15px}.brand small{color:var(--muted);font-size:11px}
.new-chat{height:47px;border-radius:15px;background:linear-gradient(100deg,#7c4dff35,#20c9ff1f,#ff4fc41b);border:1px solid #7c4dff4d;font-weight:750;text-align:left;padding:0 15px}
.new-chat:hover{transform:translateY(-2px);border-color:#7c4dffa8}
.history-head{display:flex;justify-content:space-between;color:var(--muted);font-size:12px;margin:25px 4px 9px}
.history-head button,.close{background:transparent;color:var(--muted)}
.chat-list{flex:1;overflow:auto}.chat-item{width:100%;display:flex;gap:9px;align-items:center;padding:10px;border-radius:11px;background:transparent;text-align:left;color:var(--muted);margin-bottom:3px}
.chat-item:hover,.chat-item.active{background:linear-gradient(90deg,#7c4dff22,#20c9ff0c);color:var(--text)}
.chat-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:13px}
.chat-options{opacity:0;background:transparent;color:var(--muted);width:25px}.chat-item:hover .chat-options,.chat-item.active .chat-options{opacity:1}
.sidebar-bottom{border-top:1px solid var(--border);padding-top:12px}.side-button{width:100%;padding:10px;background:transparent;color:var(--muted);text-align:left;border-radius:10px}
.side-button:hover{background:var(--hover);color:var(--text)}
.main{min-width:0;flex:1;display:flex;flex-direction:column}.topbar{
 height:64px;flex:0 0 64px;display:flex;align-items:center;justify-content:space-between;padding:0 22px;
 border-bottom:1px solid var(--border);background:#080b161c;backdrop-filter:blur(22px)
}.current-title{display:flex;align-items:center;gap:9px;font-size:14px;font-weight:700}.current-title i{width:8px;height:8px;border-radius:50%;background:#35e58b;box-shadow:0 0 14px #35e58b}
.top-actions{display:flex;gap:4px}.icon-button{width:38px;height:38px;border-radius:11px;background:transparent;color:var(--muted)}
.icon-button:hover{background:var(--hover);color:var(--text)}.mobile{display:none}
.messages{flex:1;overflow:auto;padding:30px max(20px,calc((100% - 900px)/2))}
.welcome{min-height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:30px 0 70px}
.welcome-logo{width:78px;height:78px;border-radius:25px;display:grid;place-items:center;color:#fff;font-size:33px;background:linear-gradient(135deg,#7c4dff,#20c9ff 50%,#ff4fc4);box-shadow:0 15px 45px #7c4dff45;animation:pulse 3s infinite}
@keyframes pulse{50%{transform:translateY(-5px);box-shadow:0 20px 60px #20c9ff4c}}
.eyebrow{font-size:10px;letter-spacing:2.5px;font-weight:800;margin:17px 0 8px;background:linear-gradient(90deg,#a98cff,#20c9ff,#ff65c9);-webkit-background-clip:text;color:transparent}
.welcome h1{font-size:clamp(29px,4vw,45px);letter-spacing:-1.8px;line-height:1.05;background:linear-gradient(100deg,var(--text),#a98cff,#42d8ff,#ff73cc);-webkit-background-clip:text;color:transparent}
.welcome p{color:var(--muted);margin-top:12px;font-size:14px}.suggestions{width:100%;max-width:730px;display:grid;grid-template-columns:1fr 1fr;gap:11px;margin-top:32px}
.suggestion{display:flex;gap:13px;align-items:center;padding:16px;text-align:left;border:1px solid var(--border);border-radius:17px;background:#ffffff08;transition:.2s}
.suggestion:hover{transform:translateY(-3px);border-color:var(--border2);box-shadow:0 16px 35px #0002}.suggestion-icon{width:39px;height:39px;display:grid;place-items:center;border-radius:12px;color:#fff;font-weight:800;flex:0 0 39px}
.purple{background:linear-gradient(135deg,#7c4dff,#a66cff)}.blue{background:linear-gradient(135deg,#168cff,#20c9ff)}
.pink{background:linear-gradient(135deg,#ff3eae,#ff76d2)}.orange{background:linear-gradient(135deg,#ff8b32,#ffc34f)}
.suggestion b,.suggestion small{display:block}.suggestion b{font-size:13px}.suggestion small{color:var(--muted);margin-top:3px;font-size:11px}
.message{display:flex;gap:12px;margin:18px 0;animation:in .22s ease}.message.user{justify-content:flex-end}
@keyframes in{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}
.avatar{flex:0 0 34px;height:34px;border-radius:11px;display:grid;place-items:center;background:linear-gradient(135deg,#7c4dff,#20c9ff,#ff4fc4);color:#fff;font-size:11px;font-weight:800}
.message.user .avatar{order:2;background:var(--solid);color:var(--muted);border:1px solid var(--border)}
.bubble{max-width:min(75%,720px);padding:12px 15px;border-radius:17px;background:var(--bubble);border:1px solid var(--border);line-height:1.55;font-size:14px;white-space:pre-wrap;overflow-wrap:anywhere}
.message.user .bubble{background:linear-gradient(135deg,#6848e7,#3979ed 58%,#168fd9);color:#fff;border-bottom-right-radius:5px}
.message.ai .bubble{border-bottom-left-radius:5px}.code{margin-top:10px;background:#090d18;border:1px solid #fff2;border-radius:12px;padding:13px;overflow:auto;font:12px monospace;white-space:pre}
.composer-area{width:min(900px,calc(100% - 30px));margin:0 auto;padding:10px 0 16px}.modes{display:flex;gap:7px;margin-bottom:8px}
.mode{padding:7px 12px;border-radius:10px;background:transparent;color:var(--muted);font-size:12px}.mode.active{background:#7c4dff24;color:#bcaeff;border:1px solid #7c4dff33}
.composer{display:flex;align-items:flex-end;gap:7px;min-height:59px;padding:8px;border:1px solid var(--border2);border-radius:19px;background:var(--input);box-shadow:0 24px 70px #0005;backdrop-filter:blur(18px)}
.composer:focus-within{border-color:#7c4dff85;box-shadow:0 0 0 3px #7c4dff12,0 24px 70px #0005}
.attach,.send{width:40px;height:40px;flex:0 0 40px;border-radius:12px}.attach{background:transparent;color:var(--muted);font-size:22px}
.send{background:linear-gradient(135deg,#7c4dff,#4777ed 55%,#20c9ff);color:#fff;box-shadow:0 7px 20px #4a5be640}.send:disabled{opacity:.45}
textarea{width:100%;max-height:180px;resize:none;border:0;outline:0;background:transparent;color:var(--text);padding:9px 3px;line-height:1.45}
.privacy{text-align:center;color:var(--muted);opacity:.7;font-size:10px;margin-top:8px}
.modal{position:fixed;inset:0;z-index:50;display:grid;place-items:center;padding:20px;background:#0009;backdrop-filter:blur(10px)}.hidden{display:none!important}
.modal-card{position:relative;width:min(420px,100%);padding:31px;border:1px solid var(--border2);border-radius:25px;background:var(--solid);box-shadow:0 24px 80px #0008;text-align:center}
.close{position:absolute;top:12px;right:14px;font-size:24px}.modal-icon{width:56px;height:56px;border-radius:18px;margin:0 auto 15px}
.modal-card p,.modal-card small{color:var(--muted);line-height:1.5}.modal-card input{width:100%;margin-top:15px;padding:12px;border-radius:13px;border:1px solid var(--border2);background:var(--input);color:var(--text);outline:0}
.primary{width:100%;margin-top:10px;padding:12px;border-radius:13px;color:#fff;font-weight:750;background:linear-gradient(135deg,#7c4dff,#4777ed,#20c9ff)}
.share-link-box{margin-top:15px;padding:13px;border-radius:12px;background:var(--bubble);border:1px solid var(--border);font-size:12px;word-break:break-all;text-align:left}
@media(max-width:760px){
 .sidebar{position:fixed;inset:0 auto 0 0;transform:translateX(-105%);transition:.25s;box-shadow:20px 0 60px #0005}.sidebar.open{transform:none}
 .backdrop{display:none;position:fixed;inset:0;z-index:19;background:#0009}.backdrop.show{display:block}.mobile{display:block}
 .topbar{padding:0 10px}.messages{padding:20px 14px}.suggestions{grid-template-columns:1fr}.bubble{max-width:86%}
 .composer-area{width:calc(100% - 18px);padding-bottom:9px}.modes{overflow:auto}.mode{white-space:nowrap}
}

.trash-icon svg {
  width: 17px;
  height: 17px;
  display: block;
  margin: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.trash-icon:hover {
  color: #ff4d67 !important;
  background: rgba(255, 77, 103, .10) !important;
}
.chat-options {
  font-size: 0;
}
.chat-options::before {
  content: "✎";
  font-size: 13px;
}

.attachment-tray{display:flex;flex-wrap:wrap;gap:7px;padding:7px 2px 4px}
.attachment-chip{display:flex;align-items:center;gap:7px;max-width:260px;padding:7px 9px;border:1px solid var(--border);border-radius:11px;background:var(--bubble);font-size:11px}
.attachment-chip .file-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}
.remove-file{width:21px;height:21px;border-radius:7px;background:transparent;color:var(--muted)}
.remove-file:hover{background:var(--hover);color:var(--text)}
.drop-hint{height:0;overflow:hidden;opacity:0;text-align:center;color:#7c4dff;font-size:11px;transition:.18s}
.composer-area.dragging .drop-hint{height:24px;opacity:1;padding-top:7px}
.composer-area.dragging .composer{border-color:#7c4dff;box-shadow:0 0 0 3px #7c4dff18,0 24px 70px #0005}

/* Unique Matrix attachment button */
.matrix-attach{
  position:relative;
  width:42px;
  height:42px;
  flex:0 0 42px;
  display:grid;
  place-items:center;
  border-radius:14px;
  overflow:hidden;
  background:linear-gradient(145deg,#7c4dff20,#20c9ff18);
  border:1px solid #7c4dff3d;
  color:var(--text);
  transition:transform .2s ease,border-color .2s ease,box-shadow .2s ease,background .2s ease;
}
.matrix-attach svg{
  position:relative;
  z-index:2;
  width:22px;
  height:22px;
  fill:none;
  stroke:currentColor;
  stroke-width:2.1;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.matrix-attach .attach-spark{
  stroke:#20c9ff;
  stroke-width:1.7;
}
.matrix-attach .attach-orbit{
  position:absolute;
  width:24px;
  height:24px;
  border-radius:50%;
  border:1px solid #7c4dff55;
  transform:rotate(45deg);
  transition:.25s;
}
.matrix-attach:hover{
  transform:translateY(-2px) rotate(-2deg);
  border-color:#7c4dff99;
  background:linear-gradient(145deg,#7c4dff38,#20c9ff28);
  box-shadow:0 8px 25px #7c4dff2e;
}
.matrix-attach:hover .attach-orbit{
  width:30px;
  height:30px;
  border-color:#20c9ff88;
  transform:rotate(135deg);
}
.matrix-attach:active{
  transform:scale(.94);
}
.matrix-attach::after{
  content:"";
  position:absolute;
  inset:-20%;
  background:linear-gradient(120deg,transparent 35%,#ffffff28 50%,transparent 65%);
  transform:translateX(-100%) rotate(10deg);
  transition:.5s;
}
.matrix-attach:hover::after{
  transform:translateX(100%) rotate(10deg);
}
