* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: -apple-system, "Helvetica Neue", "Noto Sans Thai", "PingFang SC", "Noto Sans SC", sans-serif; background: #2b2f36; }
.phone { max-width: 430px; height: 100dvh; margin: 0 auto; display: flex; flex-direction: column; background: #8cabd8; position: relative; box-shadow: 0 0 40px rgba(0,0,0,.4); }
.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #273246; color: #fff; }
.topbar .back { font-size: 28px; line-height: 1; opacity: .8; }
.topbar .title { flex: 1; }
.topbar .name { font-weight: 700; font-size: 16px; }
.topbar .badge { background: #06c755; border-radius: 50%; font-size: 10px; padding: 1px 4px; vertical-align: middle; }
.topbar .sub { font-size: 11px; opacity: .7; }
.topbar .dash { color: #fff; text-decoration: none; font-size: 20px; }
.mode { font-size: 11px; text-align: center; background: #fff8d6; color: #6b5800; padding: 3px; display: none; }
.chat { flex: 1; overflow-y: auto; padding: 12px 10px 4px; }
.day { text-align: center; margin: 4px 0 12px; }
.day span { background: rgba(0,0,0,.18); color: #fff; font-size: 11px; padding: 3px 10px; border-radius: 10px; }
.row { display: flex; align-items: flex-end; gap: 6px; margin: 8px 0; }
.row.me { justify-content: flex-end; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><text x="50%" y="58%" font-size="24" text-anchor="middle" dominant-baseline="middle">🧁</text></svg>') center/cover; flex: none; align-self: flex-start; }
.bubble { max-width: 74%; padding: 8px 11px; border-radius: 18px; font-size: 14.5px; line-height: 1.42; white-space: pre-wrap; word-break: break-word; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.them .bubble { background: #fff; color: #111; border-top-left-radius: 4px; }
.me .bubble { background: #06c755; color: #fff; border-top-right-radius: 4px; }
.bubble a { color: #0a63d1; word-break: break-all; }
.me .bubble a { color: #fff; }
.time { font-size: 10px; color: rgba(0,0,0,.45); flex: none; }
.typing .bubble { color: #888; }
.card { background: #fff; border-radius: 16px; width: 74%; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.card .head { background: #003087; color: #fff; padding: 10px 12px; font-weight: 700; font-size: 14px; }
.card .head span { color: #8ecfff; }
.card .body { padding: 10px 12px; font-size: 13.5px; }
.card .amt { font-size: 22px; font-weight: 800; margin: 2px 0 6px; }
.card .muted { color: #777; font-size: 12px; }
.card .pp { display: block; margin: 10px 12px 12px; background: #ffc439; color: #111; text-align: center; padding: 11px; border-radius: 22px; font-weight: 800; text-decoration: none; }
.card .pp i { font-style: italic; color: #003087; }
.card.paid .head { background: #06c755; }
.system { text-align: center; margin: 10px 0; }
.system span { background: rgba(255,255,255,.85); font-size: 12px; padding: 5px 12px; border-radius: 12px; display: inline-block; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 6px 10px; scrollbar-width: none; }
.chips button { flex: none; border: 1px solid #06c755; color: #06a847; background: #fff; border-radius: 16px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.composer { display: flex; align-items: center; gap: 8px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: #fff; }
.composer .plus { color: #999; font-size: 20px; }
.composer input { flex: 1; border: 0; background: #f1f2f4; border-radius: 18px; padding: 9px 14px; font-size: 15px; outline: none; }
.composer button { border: 0; background: none; color: #06c755; font-size: 22px; cursor: pointer; }
.composer button:disabled { color: #bbb; }
