html,body,#root{margin:0;height:100%}
body{background:#f4f1ea}
.dh{display:flex;flex-direction:column;height:100vh;height:100dvh;max-width:640px;margin:0 auto;background:#faf8f3;font-family:system-ui,-apple-system,"Segoe UI",Tahoma,sans-serif;color:#1a2b22}
.dh-h{display:flex;align-items:center;gap:12px;padding:14px 16px;background:#0f4d3a;color:#fff}
.dh-logo{width:40px;height:40px;border-radius:50%;background:#c9a24a;color:#0f4d3a;display:grid;place-items:center;font-size:22px;font-weight:700}
.dh-t{font-size:18px;font-weight:700}.dh-s{font-size:12px;opacity:.8}
.dh-m{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:8px}
.dh-b{max-width:80%;padding:10px 14px;border-radius:16px;line-height:1.6;font-size:16px;white-space:pre-wrap;word-break:break-word}
.dh-b.bot{align-self:flex-start;background:#fff;border:1px solid #e6e0d2;border-top-right-radius:4px}
.dh-b.me{align-self:flex-end;background:#0f4d3a;color:#fff;border-top-left-radius:4px}
.dh-ty{display:flex;gap:4px;padding:14px}
.dh-ty i{width:7px;height:7px;border-radius:50%;background:#9aa;animation:b 1s infinite}
.dh-ty i:nth-child(2){animation-delay:.15s}.dh-ty i:nth-child(3){animation-delay:.3s}
@keyframes b{0%,60%,100%{opacity:.3}30%{opacity:1}}
.dh-f{display:flex;gap:8px;padding:10px 12px calc(10px + env(safe-area-inset-bottom));background:#fff;border-top:1px solid #e6e0d2}
.dh-f input{flex:1;font-size:16px;padding:12px 14px;border:1px solid #d8d2c2;border-radius:24px;outline:none;background:#faf8f3}
.dh-f button{font-size:15px;padding:0 20px;border:0;border-radius:24px;background:#0f4d3a;color:#fff;font-weight:600}
.dh-f button:disabled{opacity:.5}
.dh-h{padding-top:calc(14px + env(safe-area-inset-top))}

.dh-f #mic{padding:0 14px;background:#c9a24a;font-size:18px}.dh-f #mic.rec{background:#b3261e;animation:p 1s infinite}@keyframes p{50%{opacity:.6}}

/* Keep the chat composer within narrow mobile viewports. */
.dh{width:100%;box-sizing:border-box;min-width:0}.dh-f{min-width:0;box-sizing:border-box}.dh-f input{min-width:0;width:0}.dh-f button{flex-shrink:0}

.nf-speech{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:12px;padding-top:8px;border-top:1px solid #ddd}.nf-speech button,.nf-speech select{font:inherit;font-size:13px;min-height:44px;border:1px solid #cbd5e1;border-radius:9px;background:#fff;color:#15364a;padding:6px 10px;cursor:pointer}.nf-speech-note{display:block;width:100%;font-size:12px;line-height:1.6;color:#536471}.nf-speech button:disabled{opacity:.6;cursor:default}

.nf-reply{display:block;margin-top:8px;padding:6px 10px;min-height:36px;border:1px solid #cad4cc;border-radius:8px;background:transparent;color:inherit;font:inherit;font-size:13px;cursor:pointer}.nf-quote{margin:0 0 8px;padding:8px 10px;border-right:3px solid #c9a24a;background:rgba(150,150,150,.12);border-radius:6px;font-size:13px;white-space:normal}.nf-quote strong,.nf-quote span{display:block}.nf-quote-preview{padding:8px 14px;background:#f0eee6;border-top:1px solid #ddd}.nf-quote-preview[hidden]{display:none}.nf-quote-preview button{min-height:36px;font:inherit;background:white;border:1px solid #ccc;border-radius:8px}.nf-message-text{unicode-bidi:plaintext}
.nf-time{display:block;font-size:11px;opacity:.55;margin-top:4px;text-align:end;direction:rtl;line-height:1}
.nf-day{align-self:center;background:#e9e3d2;color:#5b5440;font-size:12px;padding:4px 12px;border-radius:12px;margin:6px 0}
