:root{
  --bayan-chat-w: clamp(760px, 56vw, 920px);
  --bayan-chat-h: clamp(560px, 74vh, 820px);
  --bayan-chat-radius: 28px;

  --bayan-glass: rgba(255,255,255,0.14);
  --bayan-glass-strong: rgba(255,255,255,0.22);
  --bayan-border: rgba(255,255,255,0.24);

  --bayan-green-1: #62d5a8;
  --bayan-green-2: #45b88c;
  --bayan-green-3: #2f8f72;
  --bayan-ink: #12332a;
  --bayan-soft-text: rgba(255,255,255,0.84);

  --bayan-origin-x: 50vw;
  --bayan-origin-y: 55vh;
}

#bayan-central-shell{
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: transparent;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

#bayan-central-shell.is-open{
  display: flex;
}

#bayan-central-chat{
  position: relative;
  width: var(--bayan-chat-w);
  height: var(--bayan-chat-h);
  max-width: 92vw;
  max-height: 84vh;
  border-radius: var(--bayan-chat-radius);
  overflow: hidden;
  border: 1px solid var(--bayan-border);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.10) 100%);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  box-shadow:
    0 30px 80px rgba(0,0,0,0.26),
    0 0 0 1px rgba(255,255,255,0.08) inset;
  transform-origin: center center;
  opacity: 0;
  transform:
    translate(
      calc(var(--bayan-origin-x) - 50vw),
      calc(var(--bayan-origin-y) - 50vh)
    )
    scale(0.46);
  transition:
    transform 460ms cubic-bezier(.18,.89,.24,1.08),
    opacity 240ms ease;
}

#bayan-central-shell.is-open #bayan-central-chat{
  opacity: 1;
  transform: translate(0,0) scale(1);
}

#bayan-central-chat::before{
  content: "";
  position: absolute;
  inset: -18%;
  background:
    radial-gradient(circle at 50% 8%, rgba(102, 247, 193, 0.20), transparent 34%),
    radial-gradient(circle at 50% 100%, rgba(70, 184, 140, 0.16), transparent 42%);
  pointer-events: none;
}

#bayan-central-chat::after{
  content: "";
  position: absolute;
  left: 50%;
  bottom: -22px;
  width: 42%;
  height: 40px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(89, 232, 177, 0.28), transparent 70%);
  filter: blur(14px);
  pointer-events: none;
}

.bayan-central-header{
  position: relative;
  z-index: 2;
  height: 96px;
  padding: 18px 22px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  background:
    linear-gradient(135deg, rgba(98,213,168,0.96), rgba(69,184,140,0.92));
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.18);
}

.bayan-central-close{
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(17,64,51,0.16);
  color: #0f3e31;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  transition: transform .18s ease, background .18s ease;
}
.bayan-central-close:hover{
  transform: scale(1.06);
  background: rgba(17,64,51,0.24);
}

.bayan-central-titles{
  min-width: 0;
  text-align: center;
}
.bayan-central-title{
  margin: 0;
  font-size: clamp(30px, 2.6vw, 42px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: .02em;
}
.bayan-central-subtitle{
  margin-top: 8px;
  font-size: 15px;
  font-weight: 700;
  opacity: .95;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bayan-mode-pills{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.bayan-mode-pill{
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 800;
  color: #124234;
  background: rgba(255,255,255,0.70);
  transition: transform .18s ease, background .18s ease, color .18s ease;
}
.bayan-mode-pill:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,0.88);
}
.bayan-mode-pill.is-active{
  background: #114837;
  color: #fff;
}

.bayan-journey-rail{
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  min-height: 52px;
  background: rgba(255,255,255,0.46);
  border-bottom: 1px solid rgba(255,255,255,0.22);
  overflow-x: auto;
  scrollbar-width: none;
}
.bayan-journey-rail::-webkit-scrollbar{ display:none; }

.bayan-journey-chip{
  border: 1px solid rgba(17,72,55,0.10);
  background: rgba(255,255,255,0.88);
  color: #124234;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease;
}
.bayan-journey-chip:hover{
  transform: translateY(-1px);
  background: #fff;
}
.bayan-journey-chip.is-active{
  background: linear-gradient(135deg, #124234, #1d6d53);
  color: #fff;
}

.bayan-central-body{
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: 1fr auto;
  height: calc(100% - 148px);
}

.bayan-central-messages{
  padding: 18px 18px 14px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.12));
}

.bayan-welcome-card{
  border-radius: 22px;
  padding: 18px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(255,255,255,0.28);
  color: var(--bayan-ink);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.bayan-welcome-card h3{
  margin: 0 0 10px;
  font-size: 21px;
  line-height: 1.2;
}
.bayan-welcome-card p{
  margin: 0;
  font-size: 15px;
  line-height: 1.8;
}

.bayan-suggestion-grid{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.bayan-suggestion{
  border: 0;
  cursor: pointer;
  border-radius: 18px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(98,213,168,0.16), rgba(69,184,140,0.10));
  color: #124234;
  font-size: 14px;
  font-weight: 800;
  border: 1px solid rgba(17,72,55,0.08);
  transition: transform .18s ease, background .18s ease;
}
.bayan-suggestion:hover{
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(98,213,168,0.24), rgba(69,184,140,0.16));
}

.bayan-msg{
  max-width: min(78%, 640px);
  padding: 14px 16px;
  border-radius: 20px;
  font-size: 15px;
  line-height: 1.85;
  word-wrap: break-word;
  white-space: pre-wrap;
  box-shadow: 0 8px 22px rgba(0,0,0,0.08);
}
.bayan-msg.user{
  align-self: flex-end;
  background: linear-gradient(135deg, #114837, #1c6a52);
  color: #fff;
  border-bottom-right-radius: 10px;
}
.bayan-msg.assistant{
  align-self: flex-start;
  background: rgba(255,255,255,0.84);
  color: #16392f;
  border: 1px solid rgba(255,255,255,0.24);
  border-bottom-left-radius: 10px;
}

.bayan-next-step{
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bayan-next-chip{
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(98,213,168,0.18);
  color: #124234;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.bayan-typing{
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.bayan-typing span{
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #2f8f72;
  animation: bayanTyping 1s infinite ease-in-out;
}
.bayan-typing span:nth-child(2){ animation-delay: .12s; }
.bayan-typing span:nth-child(3){ animation-delay: .24s; }

@keyframes bayanTyping{
  0%,80%,100%{ transform: scale(.7); opacity: .4; }
  40%{ transform: scale(1); opacity: 1; }
}

.bayan-central-composer{
  padding: 14px 16px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  background: rgba(255,255,255,0.52);
  border-top: 1px solid rgba(255,255,255,0.24);
}

.bayan-input{
  width: 100%;
  min-height: 56px;
  border: 1px solid rgba(17,72,55,0.10);
  border-radius: 999px;
  padding: 0 20px;
  outline: none;
  font-size: 15px;
  font-weight: 700;
  color: #14382e;
  background: rgba(255,255,255,0.92);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
}
.bayan-input::placeholder{
  color: rgba(20,56,46,0.55);
}

.bayan-send{
  min-width: 118px;
  height: 56px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #62d5a8, #2f8f72);
  box-shadow: 0 12px 28px rgba(47,143,114,0.22);
  transition: transform .18s ease, filter .18s ease;
}
.bayan-send:hover{
  transform: translateY(-1px);
  filter: brightness(1.03);
}

body.bayan-central-open{
  overflow: hidden;
}

@media (max-width: 980px){
  #bayan-central-chat{
    width: min(92vw, 760px);
    height: 76vh;
  }
  .bayan-central-header{
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "close title"
      "close pills";
    height: auto;
    padding-bottom: 16px;
  }
  .bayan-central-close{ grid-area: close; }
  .bayan-central-titles{ grid-area: title; text-align: left; }
  .bayan-mode-pills{ grid-area: pills; justify-content: flex-start; }
}

@media (max-width: 640px){
  :root{
    --bayan-chat-radius: 22px;
  }
  #bayan-central-chat{
    width: 94vw;
    height: 78vh;
    max-height: 86vh;
  }
  .bayan-central-header{
    padding: 16px 14px 14px;
  }
  .bayan-central-title{
    font-size: 28px;
  }
  .bayan-central-subtitle{
    font-size: 13px;
  }
  .bayan-central-composer{
    grid-template-columns: 1fr;
  }
  .bayan-send{
    width: 100%;
  }
  .bayan-msg{
    max-width: 88%;
  }
}
