:root{
  --bg:#070a12;
  --card: rgba(16, 24, 40, .72);
  --stroke: rgba(255,255,255,.08);
  --text:#e7eaf2;
  --muted: rgba(231,234,242,.7);
  --accent:#f6c945;
  --accent2:#39c1ff;
  --good:#35e07d;
  --shadow: 0 20px 60px rgba(0,0,0,.55);
  --radius: 22px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x:hidden;
}

.bg{position:fixed; inset:0; z-index:-2; overflow:hidden}
.grid{
  position:absolute; inset:-2px;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 40% 15%, black 0%, black 35%, transparent 70%);
  opacity:.25;
}
.orb{
  position:absolute; border-radius:999px;
  filter: blur(30px);
  opacity:.45;
  transform: translateZ(0);
}
.orb1{
  width:520px; height:520px;
  left:-140px; top:-160px;
  background: radial-gradient(circle at 30% 30%, var(--accent), transparent 60%);
  animation: float1 10s ease-in-out infinite;
}
.orb2{
  width:620px; height:620px;
  right:-220px; bottom:-240px;
  background: radial-gradient(circle at 40% 40%, var(--accent2), transparent 60%);
  animation: float2 12s ease-in-out infinite;
}
@keyframes float1{0%,100%{transform:translate(0,0)}50%{transform:translate(30px,20px)}}
@keyframes float2{0%,100%{transform:translate(0,0)}50%{transform:translate(-22px,-18px)}}

.shell{
  width:min(980px, 92vw);
  margin: 32px auto 26px;
  display:flex;
  flex-direction:column;
  gap:16px;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 14px 14px;
  border:1px solid var(--stroke);
  border-radius: var(--radius);
  background: rgba(9, 12, 22, .55);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.brand{display:flex; align-items:center; gap:12px}
.avatar{
  position:relative;
  width:54px; height:54px;
  border-radius:16px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.12);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.avatar img{width:100%; height:100%; object-fit:cover; display:block}
.dot{
  position:absolute;
  width:10px; height:10px;
  right:8px; bottom:8px;
  background: var(--good);
  border-radius:999px;
  border:2px solid rgba(9,12,22,.8);
}

.titles h1{
  margin:0;
  font-size: 18px;
  letter-spacing:.2px;
}
.titles p{
  margin:2px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.actions{display:flex; align-items:center; gap:10px}

.card{
  border:1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.chat{
  height: 520px;
  overflow-y:auto;
  padding: 18px 18px 6px;
}

.msg{
  display:flex;
  gap:10px;
  margin: 10px 0;
}
.msg .bubble{
  max-width: 78%;
  padding: 12px 14px;
  border-radius: 16px;
  border:1px solid rgba(255,255,255,.08);
  line-height:1.45;
  font-size: 14px;
  white-space: pre-wrap;
}
.msg.user{justify-content:flex-end}
.msg.user .bubble{
  background: rgba(57,193,255,.12);
  border-color: rgba(57,193,255,.20);
}
.msg.bot .bubble{
  background: rgba(246,201,69,.12);
  border-color: rgba(246,201,69,.20);
}
.meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-top:6px;
  font-size: 12px;
  color: rgba(231,234,242,.55);
}
.badge{
  font-size:12px;
  padding: 4px 8px;
  border-radius:999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.20);
}

.composer{
  border-top:1px solid rgba(255,255,255,.08);
  padding: 14px 14px 16px;
  background: rgba(9, 12, 22, .32);
}
form{
  display:flex;
  gap:10px;
  align-items:center;
}
input{
  flex:1;
  padding: 14px 14px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.25);
  color: var(--text);
  outline:none;
}
input:focus{
  border-color: rgba(57,193,255,.35);
  box-shadow: 0 0 0 4px rgba(57,193,255,.10);
}

.btn{
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(246,201,69,.35);
  background: rgba(246,201,69,.95);
  color: #101828;
  font-weight: 800;
  cursor:pointer;
  transition: transform .06s ease, filter .15s ease;
}
.btn:hover{filter: brightness(1.02)}
.btn:active{transform: translateY(1px)}
.btn.ghost{
  background: rgba(255,255,255,.06);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.12);
  font-weight: 700;
}

.hint{
  margin-top: 10px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  color: rgba(231,234,242,.65);
  font-size: 12px;
}
.chip{
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.18);
  color: rgba(231,234,242,.85);
  padding: 6px 10px;
  border-radius: 999px;
  cursor:pointer;
}
.chip:hover{border-color: rgba(57,193,255,.30)}

.typing{
  display:inline-flex;
  gap:6px;
  align-items:center;
}
.typing span{
  width:6px; height:6px;
  border-radius:999px;
  background: rgba(231,234,242,.65);
  display:inline-block;
  animation: blink 1.2s infinite;
}
.typing span:nth-child(2){animation-delay:.15s}
.typing span:nth-child(3){animation-delay:.3s}
@keyframes blink{0%,100%{opacity:.25}50%{opacity:1}}

.foot{
  text-align:center;
  color: rgba(231,234,242,.55);
  font-size: 12px;
  padding: 8px 0 2px;
}

@media (max-width:640px){
  .chat{height: 66vh}
  .msg .bubble{max-width: 92%}
  .titles p{display:none}
}