:root{
  --bg1:#eaf2ff;
  --bg2:#f6fbff;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --stroke:rgba(15,23,42,.10);
  /* --shadow:0 24px 70px rgba(2,6,23,.16); */
  --blue:#2d66d3;
  --blue2:#204a9b;
  --bubble:#f3f5f7;
  --bubble2:#e7f0ff;
  --radius:0px;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--text);
  /* background: #eef3ff; */
  min-height:100vh;
}

.page{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
}

.card{
  width: 420px;
  max-width: 96vw;
  height: 720px;
  max-height: 92vh;
  background: #3678f0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border:1px solid var(--stroke);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

.topbar{
  padding:14px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  /* border-bottom:1px solid var(--stroke); */
  /* background: linear-gradient(180deg, var(--blue) 0%, var(--blue2) 100%); */
  color:#fff;
}

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

.brand{display:flex;gap:10px;align-items:center}
.avatar{width:120px;height:42px;display:flex;align-items:center;justify-content:center;background:transparent;border:none;}
.avatar img{max-width:120px;max-height:42px;display:block}
.titles .name{font-weight:800;line-height:1.1}
.titles .sub{font-size:12px;opacity:.9;margin-top:2px}

.icon{
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.14);
  color:#fff;
  border-radius:0;
  padding:8px 10px;
  cursor:pointer;
}
.icon:hover{background:rgba(255,255,255,.22)}

.chat{
  flex:1;
  padding:14px;
  overflow:auto;
  display:flex;
  flex-direction:column;
  gap:10px;
  background: #f7f9ff;
}

.row{display:flex}
.row.user{justify-content:flex-end}
.row.bot{justify-content:flex-start}

/* message wrapper + statuses */
.msgwrap{display:flex;flex-direction:column;align-items:flex-end;gap:4px}
.row.bot .msgwrap{align-items:flex-start}

.status{
  font-size:12px;
  color:var(--muted);
  padding:0 2px;
  user-select:none;
}

.row.system{justify-content:center}
.bubble.system{
  background:#fff7ed;
  border-color:rgba(124,45,18,.18);
  color:#7c2d12;
  font-size:13px;
}


.bubble{
  max-width:84%;
  padding:10px 12px;
  border-radius:0;
  border:1px solid var(--stroke);
  background: var(--bubble);
  font-size:14px;
  line-height:1.35;
  white-space:pre-wrap;
  word-break:break-word;
}
.row.user .bubble{
  background: var(--bubble2);
  border-color: rgba(37,99,235,.22);
}

.quick{
  padding: 10px 12px 12px 12px;
  border-top:1px solid var(--stroke);
  background:#fff;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  min-height: 56px;
  align-content:flex-start;
}

.qbtn{
  border:none;
  cursor:pointer;
  padding:10px 12px;
  border-radius: 0;
  background: linear-gradient(180deg, var(--blue) 0%, var(--blue2) 100%);
  color:#fff;
  font-weight:700;
  font-size:13px;
  box-shadow: 0 8px 18px rgba(37,99,235,.18);
}
.qbtn.secondary{
  background:#f1f5f9;
  color:var(--text);
  border:1px solid var(--stroke);
  box-shadow:none;
  font-weight:700;
}
.qbtn:hover{filter:brightness(1.03)}

.composer{
  padding:12px;
  display:flex;
  gap:10px;
  border-top:1px solid var(--stroke);
  background:#ffffff;
}
.composer input{
  flex:1;
  border-radius:0;
  border:1px solid var(--stroke);
  padding:12px 12px;
  outline:none;
  background:#fff;
}
.composer input:focus{
  border-color: rgba(37,99,235,.35);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

.send{
  border:none;
  border-radius:0;
  padding:0 16px;
  background: linear-gradient(180deg, var(--blue) 0%, var(--blue2) 100%);
  color:#fff;
  font-weight:900;
  cursor:pointer;
}
.send:disabled{
  opacity:.45;
  cursor:not-allowed;
  filter:grayscale(0.2);
}
.chat-header{
  position:relative;
}

.chat-close{
  margin-left:8px;
  width:28px;
  height:28px;
  border:0;
  background:rgba(255,255,255,.15);
  color:#fff;
  font-size:16px;
  cursor:pointer;
  border-radius:4px;
}
.chat-close:hover{
  background:rgba(255,255,255,.25);
}
