* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
}
body {
  display: flex;
  background: radial-gradient(circle at 50% 20%, #1f3a2e 0%, #0f1a14 70%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #fff;
}
.wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  text-align: center;
  padding: 12px 16px;
  max-width: 420px;
  margin: 0 auto;
}
.top-half {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.bottom-half {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding-top: 10px;
}
h1 {
  letter-spacing: 1px;
  font-weight: 700;
  opacity: 0.95;
  margin: 0 0 12px;
  font-size: 20px;
}
.avatar {
  width: 110px;
  height: 110px;
  line-height: 110px;
  font-size: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  margin: 0 auto 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  transition: box-shadow 0.2s ease, opacity 0.2s ease;
}
.avatar.idle { opacity: 0.85; }
.avatar.listening { animation: pulseListen 1.4s ease-in-out infinite; }
.avatar.speaking {
  box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.55), 0 8px 30px rgba(0, 0, 0, 0.4);
}
@keyframes pulseListen {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.45); }
  50% { box-shadow: 0 0 0 12px rgba(46, 204, 113, 0); }
}
.live-btn {
  border: none;
  border-radius: 999px;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  background: #2ecc71;
  color: white;
  transition: background 0.2s ease, transform 0.1s ease;
}
.live-btn:active { transform: scale(0.97); }
.input-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
}
.input-btn {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 10px 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  color: white;
}
.input-btn:active { transform: scale(0.96); }
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 20px;
}
.modal-card {
  position: relative;
  max-width: 420px;
  width: 100%;
  background: #14261d;
  border-radius: 16px;
  padding: 22px 18px 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  text-align: center;
}
.modal-card h3 { margin: 0 0 16px; font-size: 16px; font-weight: 700; }
.modal-close-btn {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #e74c3c;
  color: white;
  font-size: 15px;
  cursor: pointer;
}
.form-field {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: white;
  font-size: 14px;
  font-family: inherit;
}
.form-textarea { min-height: 90px; resize: vertical; }
.submit-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: none;
  border-radius: 999px;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: #2ecc71;
  color: white;
}
.photo-spinner {
  font-size: 40px;
  animation: photoSpin 1s linear infinite;
  margin-bottom: 10px;
}
@keyframes photoSpin {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}
.live-btn.on { background: #e74c3c; }
.status {
  min-height: 20px;
  opacity: 0.7;
  margin: 10px 0 4px;
  font-size: 13px;
}
.hint {
  margin: 8px 0 0;
  font-size: 12px;
  opacity: 0.5;
}
.caption {
  min-height: 60px;
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 8px 0 12px;
}
.caption:empty {
  background: transparent;
  border-color: transparent;
  min-height: 0;
  padding: 0;
  margin: 0;
}
/* (2026-08-16) Kartu ringkasan total -- muncul otomatis pas SIMO jawab
   pertanyaan "total pengeluaran..." (dari pesan WS type:"totals"),
   tampilkan angka besar + rincian per-kategori berbentuk bar sederhana
   (lebar bar proporsional thd kategori tertinggi) supaya kelihatan
   sekilas kategori mana yang paling boros. */
.totals-card {
  text-align: left;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 16px;
}
.totals-header {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}
.totals-header .totals-sub {
  display: block;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.6;
  margin-top: 2px;
}
.totals-breakdown { margin-top: 12px; }
.totals-row {
  margin-bottom: 10px;
}
.totals-row-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 4px;
}
.totals-row-bar-wrap {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}
.totals-row-bar {
  height: 100%;
  background: #2ecc71;
  border-radius: 999px;
}
