:root {
  --hijau: #0F7A5C;
  --hijau-tua: #0B5E4A;
  --hijau-muda: #E3F1EC;
  --gelembung: #D5F0C6;
  --teks: #1C1B1A;
  --pudar: #5E5A55;
  --garis: #E4E1DA;
  --latar: #E4ECE5;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--teks);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: #CFDCD1; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg { flex-shrink: 0; }

.app { position: relative; max-width: 480px; height: 100vh; height: 100dvh; margin: 0 auto; background: #fff; overflow: hidden; }
@media (min-width: 520px) {
  body { padding: 16px 0; }
  .app { height: calc(100vh - 32px); height: calc(100dvh - 32px); border-radius: 18px; box-shadow: 0 10px 40px rgba(0, 0, 0, .10); }
}
.egu-bg { background-color: var(--latar); background-image: url(/static/doodle.svg); background-size: 300px 300px; }

/* Layar sambutan */
.sambutan { display: flex; flex-direction: column; height: 100%; }
.sambutan-gambar { flex: 1 1 auto; min-height: 260px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.sambutan-gambar img, .profil-gambar img { width: 100%; height: 100%; object-fit: cover; }
.siluet { width: 160px; height: 160px; color: var(--hijau); }
.sambutan-isi { position: relative; margin-top: -28px; background: #fff; border-radius: 28px 28px 0 0; padding: 28px 24px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.nama-baris { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sambutan h1 { margin: 0; font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.sambutan p { margin: 0; font-size: 15px; line-height: 1.55; color: #3D3935; }
.lencana { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--hijau-muda); color: var(--hijau); font-size: 12px; font-weight: 700; }
.lencana svg { width: 15px; height: 15px; }
.tombol-utama { height: 52px; border: 0; border-radius: 14px; background: var(--hijau); color: #fff; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.tombol-utama:hover { background: var(--hijau-tua); }
.sambutan .kecil { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--pudar); }
.kecil svg { width: 13px; height: 13px; }

/* Ruang chat */
.chat { display: flex; flex-direction: column; height: 100%; }
.kepala { flex-shrink: 0; display: flex; align-items: center; height: 64px; padding: 0 10px; background: var(--hijau); color: #fff; }
.profil-tombol { flex: 1; min-width: 0; height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 6px; border: 0; border-radius: 12px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.profil-tombol:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.avatar { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; background: #fff; color: var(--hijau); display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.kepala-teks { display: flex; flex-direction: column; min-width: 0; }
.kepala-nama { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 700; }
.lencana-kecil { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; background: #fff; color: var(--hijau); font-size: 10px; font-weight: 700; }
.lencana-kecil svg { width: 11px; height: 11px; }
.kepala-sub { font-size: 12px; opacity: .9; }

.daftar-pesan { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 12px 4px; display: flex; flex-direction: column; gap: 8px; }
.chip-tanggal { align-self: center; padding: 4px 10px; border-radius: 8px; background: #fff; font-size: 11px; font-weight: 600; color: var(--pudar); }
.info-privasi { align-self: center; max-width: 310px; display: flex; gap: 6px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: #FBF4E2; font-size: 11.5px; line-height: 1.45; color: #5A4A1E; }
.info-privasi svg { width: 13px; height: 13px; margin-top: 2px; }

.gelembung { max-width: 86%; padding: 9px 12px 5px; border-radius: 14px; box-shadow: 0 1px 1px rgba(0, 0, 0, .06); font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.gelembung.echa { align-self: flex-start; background: #fff; border-top-left-radius: 4px; }
.gelembung.user { align-self: flex-end; background: var(--gelembung); border-top-right-radius: 4px; }
.gelembung p { margin: 0; }
.gelembung p + p { margin-top: 6px; }
.gelembung ul { margin: 4px 0; padding-left: 20px; }
.kaki { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 2px; font-size: 11px; color: #6B665F; }
.nilai { margin-right: auto; display: flex; gap: 2px; }
.nilai button { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: #6B665F; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.nilai button:hover:not(:disabled) { background: #F1F0EC; }
.nilai button[aria-pressed="true"] { color: var(--hijau); background: var(--hijau-muda); }
.nilai svg { width: 17px; height: 17px; }

.kartu-event { margin-top: 8px; border: 1px solid var(--garis); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.kartu-event .label { align-self: flex-start; padding: 2px 8px; border-radius: 6px; background: var(--hijau-muda); color: var(--hijau); font-size: 11px; font-weight: 700; }
.kartu-event .judul { font-weight: 700; line-height: 1.35; }
.kartu-event .meta { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--pudar); }
.kartu-event .meta svg { width: 14px; height: 14px; margin-top: 2px; }
.tombol-aksi { margin-top: 8px; min-height: 40px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; border-radius: 10px; background: var(--hijau); color: #fff; font-size: 13.5px; font-weight: 700; text-decoration: none; }
.tombol-aksi:hover { background: var(--hijau-tua); }
.tombol-aksi svg { width: 16px; height: 16px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; max-width: 94%; }
.chips button { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid #8CC2B0; background: #fff; color: var(--hijau); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.chips button:hover { background: #F0F8F5; }

.mengetik { align-self: flex-start; display: flex; gap: 4px; padding: 13px 14px; border-radius: 4px 14px 14px 14px; background: #fff; box-shadow: 0 1px 1px rgba(0, 0, 0, .06); }
.mengetik span { width: 7px; height: 7px; border-radius: 50%; background: #9A958E; animation: titik 1.2s infinite ease-in-out; }
.mengetik span:nth-child(2) { animation-delay: .15s; }
.mengetik span:nth-child(3) { animation-delay: .3s; }
@keyframes titik { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .mengetik span { animation: none; } }

.form-ketik { flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); }
.form-ketik input { flex: 1; min-width: 0; height: 46px; padding: 0 16px; border: 1px solid var(--garis); border-radius: 999px; background: #fff; font: inherit; font-size: 16px; color: var(--teks); }
.form-ketik input:focus { outline: 2px solid var(--hijau); outline-offset: 0; }
.form-ketik button { width: 46px; height: 46px; flex-shrink: 0; border: 0; border-radius: 50%; background: var(--hijau); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.form-ketik button:disabled { opacity: .6; cursor: default; }
.form-ketik svg { width: 20px; height: 20px; }

/* Info Echa */
.profil { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; overflow-y: auto; background: #F4F3EF; }
.profil-kepala { position: sticky; top: 0; z-index: 1; flex-shrink: 0; display: flex; align-items: center; gap: 4px; height: 56px; padding: 0 8px; background: #fff; }
.profil-kepala h2 { margin: 0; font-size: 17px; }
.profil-kepala button { width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--teks); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.profil-kepala svg { width: 22px; height: 22px; }
.profil-gambar { height: 300px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.profil-gambar .siluet { width: 120px; height: 120px; }
.profil-isi { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.kartu-putih { background: #fff; border-radius: 14px; padding: 16px; }
.kartu-putih h3 { margin: 0; font-size: 24px; font-weight: 800; }
.kartu-putih p { margin: 8px 0 0; font-size: 13.5px; line-height: 1.55; color: #3D3935; }
.daftar-info { padding: 0; }
.baris-info { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid #ECE9E3; }
.baris-info:last-child { border-bottom: 0; }
.baris-info svg { width: 18px; height: 18px; margin-top: 2px; color: var(--hijau); }
.baris-info div { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.baris-info .label { font-size: 12px; color: var(--pudar); }
