*{box-sizing:border-box}
:root{
  --bg:#f6f7f9;
  --panel:#fff;
  --text:#17191d;
  --muted:#707783;
  --line:#e7e9ee;
  --dark:#16181c;
  --soft:#f0f2f5;
}
html,body{
  margin:0;
  min-height:100%;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--text);
  background:var(--bg)
}
button,input,textarea{font:inherit}
.app-body{height:100vh;overflow:hidden}
.app-shell{
  height:100vh;
  display:grid;
  grid-template-columns:280px 1fr
}
.sidebar{
  background:#101216;
  color:#fff;
  display:flex;
  flex-direction:column;
  padding:16px 12px
}
.side-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:5px 8px 17px
}
.brand-inline{
  display:flex;
  align-items:center;
  gap:10px
}
.brand-dot{
  width:31px;
  height:31px;
  border-radius:10px;
  background:#fff;
  color:#15171b;
  display:grid;
  place-items:center;
  font-weight:900
}
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  border:0;
  border-radius:13px;
  height:46px;
  padding:0 16px;
  font-weight:700;
  cursor:pointer
}
.full{width:100%}
.new-chat{
  background:#23262c;
  color:#fff;
  border:1px solid #2e3239;
  margin-bottom:17px
}
.history{overflow:auto;flex:1}
.history-label{
  color:#8e949f;
  text-transform:uppercase;
  font-size:10px;
  letter-spacing:.12em;
  font-weight:800;
  padding:8px
}
.history-item{
  display:block;
  text-decoration:none;
  color:#cfd3d9;
  padding:10px 11px;
  border-radius:10px;
  font-size:13px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  margin:2px 0
}
.history-item:hover,.history-item.active{
  background:#1f2228;
  color:#fff
}
.empty-side{
  font-size:12px;
  color:#777e89;
  padding:10px
}
.side-footer{
  border-top:1px solid #262930;
  padding:14px 6px 4px;
  display:grid;
  gap:10px
}
.user-chip{
  display:flex;
  gap:10px;
  align-items:center
}
.user-chip .avatar{
  width:34px;
  height:34px;
  border-radius:50%;
  background:#2a2e35;
  display:grid;
  place-items:center;
  font-weight:800
}
.user-chip div:last-child{min-width:0}
.user-chip strong,.user-chip small{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap
}
.user-chip strong{font-size:12px}
.user-chip small{
  font-size:10px;
  color:#9298a3;
  margin-top:2px
}
.logout{
  font-size:11px;
  color:#8f96a1;
  text-decoration:none;
  padding-left:44px
}
.chat-main{
  min-width:0;
  background:#fff;
  display:grid;
  grid-template-rows:64px 1fr auto
}
.topbar{
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 22px
}
.topbar>div{
  display:flex;
  align-items:center;
  gap:10px
}
.status{
  font-size:11px;
  color:#78808c;
  display:flex;
  align-items:center;
  gap:5px
}
.status i{
  width:6px;
  height:6px;
  border-radius:50%;
  background:#45a55b
}
.model-pill{
  background:#f0f2f5;
  border:1px solid #e1e4e9;
  border-radius:999px;
  padding:6px 10px;
  font-size:10px;
  font-weight:750;
  color:#616873
}
.messages{
  overflow-y:auto;
  padding:36px max(24px,calc((100% - 820px)/2));
  scroll-behavior:smooth
}
.welcome{
  min-height:100%;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  text-align:center;
  padding-bottom:7vh
}
.welcome-mark{
  width:52px;
  height:52px;
  border-radius:17px;
  margin-bottom:18px;
  font-size:20px;
  display:grid;
  place-items:center;
  background:#17191d;
  color:#fff;
  font-weight:800
}
.welcome h1{
  font-size:32px;
  letter-spacing:-.045em;
  margin:0
}
.welcome p{
  color:var(--muted);
  margin:7px 0 30px
}
.suggestions{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:9px;
  width:min(650px,100%)
}
.suggestions button{
  background:#fff;
  border:1px solid var(--line);
  border-radius:14px;
  padding:14px;
  text-align:left;
  font-size:12px;
  cursor:pointer;
  color:#4f5661
}
.suggestions button:hover{
  background:#fafafa;
  border-color:#d6d9df
}
.message{
  max-width:820px;
  margin:0 auto 28px
}
.message-role{
  font-weight:800;
  font-size:11px;
  color:#6f7681;
  margin-bottom:7px;
  text-transform:uppercase;
  letter-spacing:.05em
}
.message-content{
  font-size:15px;
  line-height:1.7;
  white-space:normal
}
.message.user .message-content{
  background:#f2f3f5;
  border-radius:16px;
  padding:12px 15px;
  margin-left:auto;
  width:max-content;
  max-width:85%
}
.message.user .message-role{text-align:right}
.composer-wrap{
  padding:12px max(18px,calc((100% - 820px)/2)) 18px;
  background:linear-gradient(to top,#fff 78%,rgba(255,255,255,.72))
}
.composer{
  border:1px solid #dfe2e7;
  border-radius:18px;
  padding:10px 10px 10px 15px;
  display:flex;
  align-items:flex-end;
  gap:10px;
  box-shadow:0 8px 30px rgba(20,24,32,.07)
}
.composer textarea{
  border:0;
  outline:0;
  resize:none;
  flex:1;
  min-height:28px;
  max-height:180px;
  padding:4px 0;
  background:transparent;
  line-height:1.5
}
.send-btn{
  border:0;
  background:#17191d;
  color:#fff;
  width:36px;
  height:36px;
  border-radius:12px;
  font-weight:800;
  cursor:pointer
}
.send-btn:disabled{opacity:.4}
.composer-note{
  text-align:center;
  color:#9aa0a9;
  font-size:9px;
  margin-top:8px
}
.typing{
  display:inline-flex;
  gap:4px;
  padding:7px 0
}
.typing i{
  width:6px;
  height:6px;
  background:#8b919a;
  border-radius:50%;
  animation:pulse 1s infinite
}
.typing i:nth-child(2){animation-delay:.15s}
.typing i:nth-child(3){animation-delay:.3s}
@keyframes pulse{
  0%,100%{opacity:.25}
  50%{opacity:1}
}
.error-text{color:#b23232}
.icon-btn{
  border:0;
  background:transparent;
  color:inherit;
  font-size:22px;
  cursor:pointer
}
.mobile-only{display:none}

@media(max-width:760px){
  .app-shell{display:block}
  .sidebar{
    position:fixed;
    z-index:20;
    left:-290px;
    top:0;
    bottom:0;
    width:280px;
    transition:left .2s;
    box-shadow:20px 0 45px rgba(0,0,0,.2)
  }
  .sidebar.open{left:0}
  .mobile-only{display:block}
  .topbar{padding:0 15px}
  .topbar>div{margin-right:auto;margin-left:10px}
  .messages{padding:24px 16px}
  .composer-wrap{padding:10px 12px 12px}
  .suggestions{grid-template-columns:1fr}
  .welcome{
    justify-content:flex-start;
    padding-top:12vh
  }
  .welcome h1{font-size:27px}
  .message.user .message-content{max-width:92%}
}