:root {
  --chat-bg: #f3f0ce;
  --chat-border: #7d8647;
  --page-bg: #d7d88a;
  --ink: #2f3318;
  --muted: #5e6540;
  --accent: #7c8f2f;
  --accent-dark: #687927;
  --overlay: #2a2a2a80;
  --assistant-bubble: #ece6b8;
  --user-bubble: #cad57a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: monospace;
  background-color: var(--page-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Crect width='120' height='120' fill='%23d7d88a'/%3E%3Ccircle cx='12' cy='18' r='1' fill='%23838b50' fill-opacity='0.24'/%3E%3Ccircle cx='44' cy='32' r='1' fill='%23838b50' fill-opacity='0.18'/%3E%3Ccircle cx='95' cy='20' r='1' fill='%23838b50' fill-opacity='0.2'/%3E%3Ccircle cx='24' cy='84' r='1' fill='%23838b50' fill-opacity='0.17'/%3E%3Ccircle cx='66' cy='64' r='1' fill='%23838b50' fill-opacity='0.2'/%3E%3Ccircle cx='104' cy='92' r='1' fill='%23838b50' fill-opacity='0.16'/%3E%3C/svg%3E");
  color: var(--ink);
}

#chatbox-sidebar-nonproduk {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 20px 14px;
}

#bungkus-chatgpt {
  position: static;
}

#bungkus-chatgpt .chatbox-chatgpt {
  display: block;
  background-color: var(--chat-bg);
  padding: 5px;
  border: 2px solid var(--chat-border);
  border-radius: 3px;
  box-shadow: 6px 8px 0px #aab35f;
}

#kaburkan-2 {
  display: none;
}

.chatbox-topbar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin: -5px -5px 2px;
  border-bottom: 2px solid var(--chat-border);
  background: linear-gradient(180deg, #829436 0%, #74862f 100%);
  color: #f8f7e3;
}

.chatbox-topbar.is-visible {
  display: flex;
}

.chatbox-topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #54631f;
  flex-shrink: 0;
}

.chatbox-topbar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chatbox-topbar-title {
  font-family: monospace;
  font-weight: 800;
  letter-spacing: 0.3px;
  font-size: 14px;
  line-height: 1;
}

#bungkus-chatgpt-scroll {
  width: 100%;
}

#chat-halaman-ai {
  display: grid;
  gap: 8px;
}

#bungkus-chatgpt #kotakchatbesar {
  margin: 2px 0 5px;
  height: min(70vh, 600px);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 12px 8px;
  scroll-behavior: smooth;
}

#chat-message-list {
  margin-top: auto;
}

#chat-message-list .chat-line:first-child {
  margin-top: 0;
}

.samlekum {
  margin: auto;
  padding: 90px 0;
  text-align: center;
  color: var(--muted);
}

.samlekum.is-stacked {
  margin: 0;
  padding: 24px 0 18px;
}

.welcome-avatar {
  width: 70px;
  height: 70px;
  margin: auto;
  border-radius: 999px;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #f7f7de;
  background: var(--accent);
  border: 2px solid #586621;
}

.welcome-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 999px;
  transform-origin: 50% 50%;
  animation: avatarSlowSwing 28s linear infinite;
}

@keyframes avatarSlowSwing {
  0% {
    transform: rotate(0deg);
  }

  50% {
    transform: rotate(10deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

.welcome-title {
  margin: 18px 0 6px;
  font-size: clamp(28px, 4.5vw, 38px);
  font-weight: 900;
  font-family: "Impact", "Haettenschweiler", "Arial Black", sans-serif;
  text-transform: lowercase;
  letter-spacing: 0.5px;
  line-height: 1;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  white-space: nowrap;
}

.welcome-title .wave-letter {
  display: inline-block;
  position: relative;
  z-index: 1;
  color: #d7db57;
  -webkit-text-stroke: 1.4px #1f2508;
  text-shadow:
    0 1px 0 #1f2508,
    0 2px 0 #42511c,
    0 4px 0 #92a44a;
}

.welcome-title .wave-space {
  display: inline-block;
  width: 0.2em;
}

.welcome-title .wave-letter:nth-child(1) {
  color: #d7db57;
  transform: translateY(4px);
}

.welcome-title .wave-letter:nth-child(3) {
  color: #d4d95a;
  transform: translateY(2px);
}

.welcome-title .wave-letter:nth-child(4) {
  color: #d1d65d;
  transform: translateY(0px);
}

.welcome-title .wave-letter:nth-child(5) {
  color: #ced260;
  transform: translateY(-2px);
}

.welcome-title .wave-letter:nth-child(6) {
  color: #cad063;
  transform: translateY(-4px);
}

.welcome-title .wave-letter:nth-child(8) {
  color: #d7db57;
  transform: translateY(-2px);
}

.welcome-title .wave-letter:nth-child(9) {
  color: #d4d95a;
  transform: translateY(0px);
}

.welcome-title .wave-letter:nth-child(10) {
  color: #d1d65d;
  transform: translateY(2px);
}

.welcome-title .wave-letter:nth-child(11) {
  color: #d7db57;
  transform: translateY(4px);
}

.welcome-title .wave-letter:nth-child(12) {
  color: #ced260;
  transform: translateY(6px);
}

.welcome-title .wave-letter:nth-child(13) {
  color: #d4d95a;
  transform: translateY(7px);
}

.welcome-subtitle {
  margin: 16px 0 0;
  font-size: 8px;
}

.welcome-micro {
  margin: 16px 0 0;
  font-size: 9px;
  color: #6a7830;
  letter-spacing: 0.4px;
}

.welcome-whatsapp-link {
  font-size: 10px;
  color: #506219;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  opacity: 0.88;
}

.welcome-whatsapp-link:hover {
  color: #3e4f13;
  opacity: 1;
}

#bungkus-chatgpt #formchatgpt {
  margin-bottom: 0;
  position: relative;
  text-align: center;
}

#bungkus-chatgpt #formchatgpt #counterketikan {
  position: absolute;
  right: 44px;
  bottom: 3px;
  font-size: 8px;
  color: var(--muted);
}

#bungkus-chatgpt #sendchatgpt {
  width: 30px;
  height: 30px;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 0 #4e5b20;
}

#bungkus-chatgpt #sendchatgpt:hover {
  background: var(--accent-dark);
}

.send-icon {
  display: inline-block;
  transform: translateY(-1px);
  font-size: 14px;
}

#bungkus-chatgpt #inputchatgpt {
  height: 50px;
  font-size: 15px;
  font-family: "Courier New", "Lucida Console", Monaco, monospace;
  padding: 0 52px 0 38px;
  width: 100%;
  border: 1px solid #8d9456;
  border-radius: 3px;
  outline: none;
  background-color: #f6f3d8;
  color: #2f3318;
  transition: opacity 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}

#bungkus-chatgpt #inputchatgpt:focus {
  border-color: #73852d;
}

#bungkus-chatgpt #bulatchatgpt {
  width: 12px;
  height: 12px;
  margin: 19px 0 0 14px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 2px #22c55e22;
  position: absolute;
  transition: background-color 0.12s ease, box-shadow 0.12s ease;
}

#bungkus-chatgpt #bulatchatgpt.is-available {
  background: #22c55e;
  box-shadow: none;
}

#bungkus-chatgpt #bulatchatgpt.is-busy {
  background: #ef4444;
  box-shadow: 0 0 0 2px #ef444422;
}

#bungkus-chatgpt #formchatgpt.is-busy #inputchatgpt {
  opacity: 0.58;
  background-color: #f3f4f6;
  border-color: #d1d5db;
  cursor: not-allowed;
}

.chat-line {
  display: flex;
  margin: 12px 0;
}

.chat-line.user {
  justify-content: flex-end;
}

.chat-line.assistant {
  justify-content: flex-start;
}

.bubble {
  max-width: min(88%, 560px);
  padding: 12px 14px;
  border-radius: 3px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-line.user .bubble {
  background: var(--user-bubble);
}

.chat-line.assistant .bubble {
  background: var(--assistant-bubble);
}

.chat-line.notice .bubble {
  background: #f0e59b;
  border: 1px solid #b4a84e;
}

.chat-line.assistant .bubble a,
.chat-line.notice .bubble a {
  color: #3d5b16;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

.chat-line.assistant .bubble a:hover,
.chat-line.notice .bubble a:hover {
  color: #2c430e;
}

#bungkus-chatgpt .sedangmenjawab {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
}

#bungkus-chatgpt .typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

#bungkus-chatgpt .typing-dots .dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #9ca3af;
  opacity: 0.25;
  animation: whatsappDots 1s infinite ease-in-out;
}

#bungkus-chatgpt .typing-dots .dot:nth-child(1) {
  animation-delay: 0s;
}

#bungkus-chatgpt .typing-dots .dot:nth-child(2) {
  animation-delay: 0.18s;
}

#bungkus-chatgpt .typing-dots .dot:nth-child(3) {
  animation-delay: 0.36s;
}

.typing-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: -0.14em;
  background: #2f3318;
  border-radius: 1px;
  animation: typingCursorBlink 0.85s steps(1, end) infinite;
}

@keyframes typingCursorBlink {
  0%,
  48% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

@keyframes whatsappDots {
  0%,
  70%,
  100% {
    transform: translateY(0);
    opacity: 0.25;
  }

  35% {
    transform: translateY(-2px);
    opacity: 1;
  }
}

@media screen and (max-width: 768px) {
  #chatbox-sidebar-nonproduk {
    padding: 8px;
  }

  .chatbox-topbar {
    padding: 8px;
    gap: 8px;
  }

  .chatbox-topbar-title {
    font-size: 13px;
  }

  .welcome-title {
    font-size: clamp(22px, 8.2vw, 30px);
    line-height: 1.18;
    letter-spacing: 0.2px;
  }

  .welcome-title .wave-letter {
    transform: translateY(0) !important;
    -webkit-text-stroke: 1px #1f2508;
    text-shadow:
      0 1px 0 #1f2508,
      0 2px 0 #42511c;
  }

  #bungkus-chatgpt .chatbox-chatgpt {
    margin: 0;
  }

  #bungkus-chatgpt #kotakchatbesar {
    height: 72vh;
    padding: 10px 6px;
  }

  .bubble {
    max-width: 92%;
  }
}
