:root {
  --wa-dark: #16181D;
  --wa-teal: #C8410F;
  --wa-green: #E8551E;
  --bg: #E9E6E0;
  --in: #FFFFFF;
  --out: #FFE3D3;
  --text: #111B21;
  --muted: #667781;
  --strip: #FFF3C4;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 15px/1.4 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; max-width: 560px; margin: 0 auto;
  background: var(--bg); box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.strip { background: var(--strip); color: #5b4a00; text-align: center; font-size: 12.5px; padding: 6px 12px;
  padding-top: calc(6px + env(safe-area-inset-top)); }
.top { display: flex; align-items: center; gap: 10px; background: var(--wa-dark); color: #fff; padding: 8px 10px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: #FFE3D3; color: #A3340B;
  display: grid; place-items: center; font-weight: 700; flex: none; }
.who { flex: 1; min-width: 0; }
.name { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status { font-size: 12.5px; opacity: .85; }
.badge { background: #ffcf33; color: #4a3b00; font-size: 10px; border-radius: 4px; padding: 1px 5px; vertical-align: middle; }
.hbtn { background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 16px; padding: 7px 10px;
  font: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.hbtn.icon { width: 34px; height: 34px; padding: 0; border-radius: 50%; font-size: 18px; }
.chat { flex: 1; overflow-y: auto; padding: 12px 10px 6px; -webkit-overflow-scrolling: touch;
  background-color: var(--bg);
  background-image: radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px);
  background-size: 18px 18px; }
.day { text-align: center; margin: 4px 0 10px; }
.day span { background: #E1F2FB; color: #54656F; font-size: 12px; padding: 4px 10px; border-radius: 8px; }
.msg { display: flex; margin: 3px 0; }
.msg.out { justify-content: flex-end; }
.bubble { max-width: 82%; padding: 6px 8px 4px 9px; border-radius: 8px; box-shadow: 0 1px .5px rgba(0,0,0,.13);
  white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.msg.in .bubble { background: var(--in); border-top-left-radius: 0; }
.msg.out .bubble { background: var(--out); border-top-right-radius: 0; }
.meta { float: right; font-size: 11px; color: var(--muted); margin: 6px 0 -2px 10px; }
.msg.out .meta::after { content: " \2713\2713"; color: #53bdeb; letter-spacing: -3px; padding-right: 3px; }
.sys { text-align: center; margin: 8px 0; }
.sys span { background: #fff5c4; color: #54656F; font-size: 12px; padding: 5px 10px; border-radius: 8px; display: inline-block; }
.typing .bubble { display: inline-flex; gap: 4px; padding: 10px 12px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa5ab; animation: b 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes b { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.quick { display: flex; gap: 8px; align-items: center; padding: 6px 10px 2px; flex-wrap: wrap; }
.quick button { background: #fff; color: var(--wa-teal); border: 1px solid #F3C9B2; border-radius: 18px;
  padding: 7px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.quick .left { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.bar { display: flex; gap: 8px; padding: 6px 8px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
.bar input { flex: 1; min-width: 0; border: 0; border-radius: 22px; padding: 11px 16px; font: inherit; font-size: 16px;
  background: #fff; outline: none; box-shadow: 0 1px .5px rgba(0,0,0,.1); }
.bar button { width: 46px; height: 46px; flex: none; border: 0; border-radius: 50%; background: var(--wa-teal); color: #fff;
  display: grid; place-items: center; cursor: pointer; }
.bar button:disabled, .quick button:disabled { opacity: .5; cursor: default; }
  display: flex; flex-direction: column; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
@media (max-width: 380px) { .hbtn:not(.icon) { font-size: 11.5px; padding: 6px 8px; } }
