:root {
  /* Teal khatulistiwa (laut + hutan) */
  --teal-900: #022c33;
  --teal-800: #053b45;
  --teal-700: #075661;
  --teal-600: #0a7480;
  --teal-500: #129aab;
  --teal-400: #34c0d2;
  --teal-300: #82dde9;
  --teal-100: #d6f3f7;
  --teal-50:  #ecfafd;

  /* Sunset coral (sunset Sungai Kapuas) */
  --coral-700: #c43d12;
  --coral-600: #e85825;
  --coral-500: #ff7444;
  --coral-400: #ff9968;
  --coral-300: #ffb992;
  --coral-100: #ffe1d2;

  /* Sand / kuning gading */
  --sand-500: #f4b860;
  --sand-400: #ffcd7a;
  --sand-300: #ffdda1;
  --sand-100: #fff1d6;
  --sand-50:  #fff8ea;

  /* Netral */
  --bg:       #fdf6ec;
  --bg-soft:  #f6efe1;
  --surface:  #ffffff;
  --text:     #0e2a30;
  --muted:    #5b7077;
  --border:   #e7d9c3;
  --shadow-sm: 0 2px 8px rgba(7, 86, 97, 0.07);
  --shadow-md: 0 10px 28px rgba(7, 86, 97, 0.12);
  --shadow-lg: 0 22px 50px rgba(7, 86, 97, 0.18);

  /* Layout */
  --hero-h: 230px;
  --composer-h: 96px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 500px at -10% -20%, rgba(255, 153, 104, 0.18), transparent 60%),
    radial-gradient(700px 420px at 110% 0%, rgba(18, 154, 171, 0.18), transparent 60%),
    radial-gradient(500px 400px at 50% 110%, rgba(244, 184, 96, 0.18), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* ===================== HERO HEADER ===================== */
.hero {
  position: relative;
  background:
    linear-gradient(135deg, var(--teal-800) 0%, var(--teal-700) 50%, var(--teal-600) 100%);
  color: white;
  overflow: hidden;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(420px 220px at 12% 30%, rgba(255, 153, 104, 0.32), transparent 70%),
    radial-gradient(360px 200px at 92% 18%, rgba(244, 184, 96, 0.28), transparent 70%);
}
.hills {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 110px;
  display: block;
}
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px clamp(16px, 4vw, 36px) 18px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: center;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.06));
  border: 1.5px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 8px 22px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.4);
  overflow: hidden;
}
.logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.brand-text h1 {
  margin: 0;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1;
  background: linear-gradient(90deg, #ffffff, var(--sand-300));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-text p {
  margin: 4px 0 0;
  font-size: 13px;
  opacity: 0.9;
  font-weight: 500;
}

/* Hero meta */
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  justify-content: flex-end;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  padding: 6px 12px;
  border-radius: 999px;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral-400);
  box-shadow: 0 0 0 3px rgba(255, 153, 104, 0.3);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,153,104,0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(255,153,104,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,153,104,0); }
}

.hero-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.hero-stat {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: 12px;
  padding: 7px 12px;
  display: flex;
  flex-direction: column;
  line-height: 1;
  text-align: left;
  transition: transform .2s, background .2s, border-color .2s;
}
.hero-stat:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,0.18);
  border-color: var(--sand-400);
}
.hero-stat strong {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  color: var(--sand-300);
  font-weight: 800;
}
.hero-stat span {
  font-size: 10.5px;
  margin-top: 4px;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 600;
}

.hero-clear {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  color: white;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.hero-clear:hover {
  background: var(--coral-500);
  border-color: var(--coral-500);
  color: white;
}

/* ===================== CATEGORIES ===================== */
.cats {
  position: sticky;
  top: 0;
  z-index: 6;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(7, 86, 97, 0.06);
}
.cats-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px clamp(16px, 4vw, 36px);
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  scroll-behavior: smooth;
}
.cats-inner::-webkit-scrollbar { height: 6px; }
.cats-inner::-webkit-scrollbar-thumb { background: var(--teal-300); border-radius: 8px; }

.cat {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg-soft);
  color: var(--teal-800);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s ease;
  white-space: nowrap;
}
.cat span { font-size: 14px; }
.cat:hover {
  background: var(--teal-50);
  border-color: var(--teal-400);
  color: var(--teal-700);
}
.cat.is-active {
  background: linear-gradient(135deg, var(--teal-700), var(--teal-600));
  border-color: var(--teal-700);
  color: white;
  box-shadow: 0 4px 12px rgba(10, 116, 128, 0.3);
}

/* ===================== PAGE / CHAT ===================== */
.page {
  position: relative;
  min-height: calc(100vh - var(--hero-h));
}
.chat {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px clamp(16px, 4vw, 36px);
  padding-bottom: calc(var(--composer-h) + 80px);
  scroll-behavior: smooth;
}

/* Welcome */
.welcome {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 880px;
  margin: 0 auto;
}
.welcome-card {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 22px;
  background:
    linear-gradient(135deg, #ffffff 0%, var(--sand-50) 60%, var(--teal-50) 100%);
  border-radius: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.welcome-card::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(255, 153, 104, 0.18) 0%, transparent 70%);
  pointer-events: none;
}
.welcome-logo {
  width: 78px;
  height: 78px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--teal-50), var(--sand-100));
  border: 1px solid var(--teal-100);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.welcome-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.welcome-text { flex: 1; min-width: 0; }
.badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--coral-700);
  background: var(--coral-100);
  border: 1px solid var(--coral-300);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.welcome-text h2 {
  margin: 2px 0 6px;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--teal-900);
  letter-spacing: -0.4px;
  line-height: 1.15;
}
.accent {
  position: relative;
  display: inline-block;
  color: var(--teal-700);
}
.accent::after {
  content: "";
  position: absolute;
  left: -2px; right: -2px; bottom: 2px;
  height: 9px;
  background: linear-gradient(90deg, var(--coral-400), var(--sand-400));
  z-index: -1;
  border-radius: 4px;
}
.welcome-text p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* Suggestions */
.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.suggestion {
  background: var(--surface);
  color: var(--teal-800);
  border: 1.5px solid var(--border);
  padding: 8px 13px 8px 11px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  line-height: 1.2;
  text-align: left;
  box-shadow: var(--shadow-sm);
}
.suggestion::before {
  content: attr(data-icon);
  font-size: 14px;
}
.suggestion:hover {
  background: linear-gradient(135deg, var(--coral-100), var(--sand-100));
  color: var(--teal-900);
  border-color: var(--coral-400);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(232, 88, 37, 0.15);
}
.suggestion.is-hidden {
  display: none;
}

/* ===================== MESSAGES ===================== */
.message {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeIn .25s ease-out;
  scroll-margin-top: 16px;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.message.user { flex-direction: row-reverse; }

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.message.bot .avatar {
  background: linear-gradient(135deg, var(--teal-700), var(--teal-500));
  color: var(--sand-300);
}
.message.user .avatar {
  background: linear-gradient(135deg, var(--coral-500), var(--coral-400));
  color: white;
}

.bubble {
  max-width: 78%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.bubble > div {
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Tombol "Buka di Google Maps" di dalam balasan bot */
.map-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--coral-500), var(--coral-400));
  color: white !important;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  border: 1px solid transparent;
  box-shadow: 0 4px 12px rgba(232, 88, 37, 0.28);
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
  white-space: normal;
  width: fit-content;
}
.map-link:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 6px 16px rgba(232, 88, 37, 0.4);
}
.map-link svg {
  flex-shrink: 0;
}
.message.bot .bubble {
  background: var(--surface);
  color: var(--text);
  border-top-left-radius: 4px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.message.user .bubble {
  background: linear-gradient(135deg, var(--teal-700), var(--teal-600));
  color: white;
  border-top-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(10, 116, 128, 0.3);
}

/* Typing */
.typing { display: inline-flex; gap: 4px; padding: 3px 0; }
.typing span {
  width: 7px; height: 7px;
  background: var(--teal-500);
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: .2s; background: var(--coral-500); }
.typing span:nth-child(3) { animation-delay: .4s; background: var(--sand-500); }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .6; }
  30%           { transform: translateY(-6px); opacity: 1; }
}

/* ===================== COMPOSER ===================== */
.composer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px clamp(16px, 4vw, 36px) 18px;
  background: linear-gradient(180deg, rgba(253, 246, 236, 0) 0%, rgba(253, 246, 236, 0.95) 35%, var(--bg) 100%);
  backdrop-filter: blur(6px);
  z-index: 5;
}
.composer-form {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 18px;
  padding: 8px 8px 8px 12px;
  box-shadow: var(--shadow-md);
  transition: border-color .2s, box-shadow .2s;
}
.composer-form:focus-within {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 4px rgba(18,154,171,0.14), var(--shadow-md);
}
.composer-icon {
  display: grid;
  place-items: center;
  color: var(--teal-600);
  padding: 10px 0 10px 0;
  flex-shrink: 0;
}
#input {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  padding: 9px 6px;
  font-size: 14px;
  font-family: inherit;
  background: transparent;
  color: var(--text);
  max-height: 130px;
  line-height: 1.5;
}
#input::placeholder { color: var(--muted); }

.send-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, var(--coral-500), var(--coral-400));
  color: white;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform .15s, box-shadow .2s;
  box-shadow: 0 6px 14px rgba(232, 88, 37, 0.35);
  flex-shrink: 0;
}
.send-btn:hover { transform: translateY(-1px) scale(1.04); }
.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.hint {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin: 6px 0 0;
}

/* ===================== FLOATING BUTTONS ===================== */
.scroll-bottom-btn {
  position: fixed;
  right: 18px;
  bottom: calc(var(--composer-h) + 16px);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--teal-700);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px) scale(0.92);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, background .2s, color .2s;
  z-index: 4;
}
.scroll-bottom-btn.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.scroll-bottom-btn:hover {
  background: linear-gradient(135deg, var(--coral-500), var(--coral-400));
  color: white;
  border-color: var(--coral-500);
}

.new-msg-pill {
  position: fixed;
  right: 18px;
  bottom: calc(var(--composer-h) + 70px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px 7px 11px;
  background: linear-gradient(135deg, var(--teal-700), var(--teal-600));
  color: white;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(10,116,128,0.35);
  opacity: 0;
  transform: translateY(8px) scale(0.92);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, box-shadow .2s;
  z-index: 4;
}
.new-msg-pill.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.new-msg-pill:hover {
  box-shadow: 0 8px 22px rgba(10,116,128,0.5);
}

/* ===================== SCROLLBARS ===================== */
body::-webkit-scrollbar { width: 9px; }
body::-webkit-scrollbar-track { background: transparent; }
body::-webkit-scrollbar-thumb {
  background: var(--teal-300);
  border-radius: 8px;
}
body::-webkit-scrollbar-thumb:hover { background: var(--teal-500); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .hero-meta { justify-content: flex-start; }
  .brand-text h1 { font-size: 24px; }
  .welcome-text h2 { font-size: 22px; }
  .welcome-card { padding: 18px; gap: 14px; }
  .welcome-logo { width: 64px; height: 64px; }
}

@media (max-width: 560px) {
  .hero-inner { padding: 18px 16px 14px; }
  .hero-stats { gap: 6px; }
  .hero-stat { padding: 6px 9px; }
  .hero-stat strong { font-size: 15px; }
  .hero-stat span { font-size: 9.5px; }
  .brand { gap: 10px; }
  .logo { width: 52px; height: 52px; border-radius: 14px; }
  .brand-text h1 { font-size: 21px; }
  .brand-text p { font-size: 11.5px; }
  .welcome-card { flex-direction: column; align-items: flex-start; }
  .welcome-logo { width: 56px; height: 56px; }
  .welcome-text h2 { font-size: 20px; }
  .welcome-text p { font-size: 13px; }
  .bubble { max-width: 86%; font-size: 13.5px; }
  .send-btn { width: 40px; height: 40px; }
  .hero-clear span { display: none; }
}
