:root{
  /* King's Bruton palette */
  --kb-navy:#15222E;
  --kb-gold:#B4975A;
  --kb-stone:#F5F4F0;
  --kb-text:#2f3b45;
  --kb-muted:#eceae4;

  --widget-w:300px;
  --widget-h:420px;

  --font-family:'Lato', sans-serif;
}

/* Ensure KB fonts if loaded late */
#school-chat-root{ font-family: var(--font-family) !important; }

#school-chat-root{
  position:fixed;
  right:18px;
  bottom:18px;
  z-index:99999;
  font-family:var(--font-family);
}

/* Launcher */
.sc-launcher{
  width:56px;
  height:56px;
  border-radius:50%;
  background:var(--kb-navy);
  color:#fff;
  font-size:24px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-shadow:0 10px 24px rgba(10,17,23,0.18);
  transition:transform .18s ease, background .18s ease;
  border:2px solid rgba(180,151,90,0.22);
}
.sc-launcher:hover{
  transform:scale(1.06);
  background: #0f1a22;
}
.sc-launcher svg{ width:22px; height:22px; color:#fff; }
.sc-launcher svg path{ fill: currentColor; }

/* Widget frame */
.sc-widget{
  width:var(--widget-w);
  height:var(--widget-h);
  border-radius:14px;
  overflow:hidden;
  box-shadow:0 22px 48px rgba(10,17,23,0.20);
  background:#fff;
  display:flex;
  flex-direction:column;
  border: 1px solid rgba(21,34,46,0.10);
}

/* Navy header with gold text */
.sc-header{
  display:flex;
  align-items:center;
  padding:10px 14px;
  background:var(--kb-navy);
  color:var(--kb-gold);
  height:56px;
  gap:8px;
  border-bottom: 1px solid rgba(180,151,90,0.35);
}
.sc-header .title{
  font-weight:700;
  font-size:15px;
  margin-left:6px;
  letter-spacing:0.2px;
}
.sc-header .close{
  margin-left:auto;
  cursor:pointer;
  font-size:18px;
  line-height:1;
  padding:6px;
  border-radius:8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(180,151,90,0.25);
  color:var(--kb-gold);
}
.sc-header .close:hover{ background: rgba(255,255,255,0.10); }
.sc-header .close svg{ width:14px; height:14px; color:var(--kb-gold); }
.sc-header .close svg path{ stroke: currentColor; }

/* Messages */
.sc-messages{
  padding:14px;
  background:var(--kb-stone);
  display:flex;
  flex-direction:column;
  gap:12px;
  overflow:auto;
  flex:1;
}

.msg{
  max-width:85%;
  padding:12px 14px;
  border-radius:14px;
  font-size:14px;
  line-height:1.4;
  box-shadow:0 6px 16px rgba(9,14,24,0.06);
}

.msg.bot{
  background:#fff;
  align-self:flex-start;
  color:var(--kb-text);
  border:1px solid rgba(21,34,46,0.08);
  border-top-left-radius:8px;
}

.msg.user{
  background: linear-gradient(90deg, var(--kb-navy), #0f1a22);
  color:#fff;
  align-self:flex-end;
  border-top-right-radius:8px;
  border:1px solid rgba(180,151,90,0.18);
}

/* Input */
.sc-input{
  padding:10px;
  display:flex;
  gap:10px;
  align-items:center;
  border-top:1px solid rgba(21,34,46,0.08);
  background:#fff;
}

.sc-input input{
  flex:1;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid rgba(21,34,46,0.12);
  font-size:14px;
  background:#fff;
}

.sc-input button{
  width:44px;
  height:44px;
  border-radius:50%;
  border:none;
  background:var(--kb-navy);
  color:var(--kb-gold);
  cursor:pointer;
  font-size:16px;
  box-shadow:0 10px 22px rgba(21,34,46,0.18);
  border:1px solid rgba(180,151,90,0.28);
}

.chip{
  padding:8px 12px;
  border-radius:999px;
  background:#fff;
  border:1px solid rgba(21,34,46,0.12);
  cursor:pointer;
  box-shadow:0 6px 16px rgba(9,14,24,0.04);
  font-size:13px;
}
.chip:hover{ transform: translateY(-2px); border-color: rgba(180,151,90,0.55); }

.typing{
  width:40px;
  display:flex;
  gap:6px;
  align-items:center;
}
.typing span{
  width:7px;
  height:7px;
  background: rgba(21,34,46,0.30);
  border-radius:50%;
  animation:bounce .9s infinite;
}
.typing span:nth-child(2){ animation-delay:.12s }
.typing span:nth-child(3){ animation-delay:.24s }

@keyframes bounce{ 0%{transform:translateY(0);}50%{transform:translateY(-6px);}100%{transform:translateY(0);} }

@media (max-width:420px){
  :root{ --widget-w:92vw; --widget-h:64vh; }
  #school-chat-root{ right:12px; bottom:12px; }
  .sc-widget{ border-radius:12px; }
}

