* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  overflow: hidden;
  background: #f6f4f7;
  color: #2b1d29;
}

.wrapper {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: radial-gradient(
      circle at bottom center,
      rgba(223, 174, 222, 0.45),
      transparent 35%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(186, 170, 255, 0.35),
      transparent 30%
    ),
    #f6f4f7;
  overflow: hidden;
}

/* HEADER TETAP */
.header {
  flex-shrink: 0;
  text-align: center;
  padding: 24px 20px 24px;
  background: transparent;
  z-index: 2;
}

.sparkle {
  font-size: 34px;
  line-height: 1;
  margin-bottom: 18px;
  color: #24101f;
}

.title {
  font-size: 20px;
  font-weight: 500;
  color: #342231;
}

/* AREA CHAT SAJA YANG SCROLL */
.chat-scroll {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 20px 20px;
  display: flex;
  justify-content: center;
}

.chat-area {
  width: 100%;
  max-width: 980px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 8px;
}

.chat-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 76%;
}

.chat-row.left {
  align-self: flex-start;
}

.chat-row.right {
  align-self: flex-end;
}

.label {
  font-size: 11px;
  letter-spacing: 0.03em;
  color: #7f7480;
  text-transform: uppercase;
  padding: 0 10px;
}

.bubble {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid #e7dfe8;
  border-radius: 18px;
  padding: 18px 20px;
  font-size: 16px;
  line-height: 1.55;
  color: #362b36;
  box-shadow: 0 4px 14px rgba(60, 35, 60, 0.03);
  backdrop-filter: blur(4px);

  /* Tambahan agar output AI rapi */
  /* white-space: pre-wrap; */
  word-break: break-word;
  overflow-wrap: anywhere;
}

.bubble.small {
  width: fit-content;
  min-width: 180px;
}

.bubble ol {
  margin-top: 8px;
  padding-left: 24px;
}

.bubble li + li {
  margin-top: 8px;
}

/* INPUT DI BAWAH, TIDAK MENIMPA CHAT */
.footer {
  padding: 14px 20px 22px;
  display: flex;
  justify-content: center;
  background: transparent;
  z-index: 2;
}

.input-bar {
  width: min(980px, 100%);
  min-height: 60px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid #cfc8d3;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 18px;
  backdrop-filter: blur(8px);
}

.input-text {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: #2f2630;
}

.input-text::placeholder {
  color: #7d7780;
}

.send-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.send-btn svg {
  width: 28px;
  height: 28px;
  stroke: #9ba8bf;
  stroke-width: 1.8;
  fill: none;
}

.chat-scroll::-webkit-scrollbar {
  width: 8px;
}

.chat-scroll::-webkit-scrollbar-thumb {
  background: rgba(120, 100, 140, 0.25);
  border-radius: 20px;
}

.chat-scroll::-webkit-scrollbar-track {
  background: transparent;
}

@media (max-width: 768px) {
  .header {
    padding: 20px 16px 20px;
  }

  .chat-scroll {
    padding: 10px 12px 14px;
  }

  .footer {
    padding: 10px 12px 14px;
  }

  .chat-row {
    max-width: 92%;
  }

  .bubble {
    font-size: 15px;
    padding: 15px 16px;
  }
}
