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}

/* first impression (owner 4 Nov): header, bar, welcome card and starter chips */
.dh-h{background:linear-gradient(135deg,#0f4d3a 0%,#16664d 100%);box-shadow:0 2px 10px rgba(15,77,58,.18)}
.dh-logo{box-shadow:0 0 0 3px rgba(255,255,255,.18)}
.nf-bar{display:flex;align-items:center;gap:10px;padding:6px 12px;background:#f1ede2;border-bottom:1px solid #e6e0d2;font-size:13px}
.nf-pill{background:#fff1c2;color:#4b3700;border-radius:999px;padding:3px 10px;font-weight:600}
.nf-link{color:#0f4d3a;text-decoration:none;padding:6px 4px}
.nf-out{margin-inline-start:auto;font:inherit;font-size:13px;min-height:36px;padding:4px 12px;border:1px solid #cfc7b4;border-radius:10px;background:#fff;color:#173c30;cursor:pointer}
.dh-b.bot{box-shadow:0 1px 2px rgba(0,0,0,.04)}
.nf-welcome{max-width:92%;padding:16px;border:1px solid #e3dcc9;background:linear-gradient(180deg,#fff 0%,#fbf8f0 100%);border-radius:18px;border-top-right-radius:6px;animation:nfIn .45s ease-out both}
.nf-welcome .nf-hi{display:block;font-size:19px;font-weight:700;color:#0f4d3a;margin-bottom:4px}
.nf-welcome .nf-sub{display:block;font-size:15px;color:#3d4b43;margin-bottom:12px}
.nf-chips{display:flex;flex-wrap:wrap;gap:8px}
.nf-chip{font:inherit;font-size:14px;min-height:40px;padding:6px 14px;border:1px solid #cdbf98;border-radius:999px;background:#fff;color:#0f4d3a;cursor:pointer;transition:transform .12s ease,background .12s ease}
.nf-chip:hover,.nf-chip:focus-visible{background:#f6efd9;outline:none;transform:translateY(-1px)}
.nf-chip:active{transform:scale(.97)}
@keyframes nfIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.nf-welcome{animation:none}.nf-chip{transition:none}}
.nf-key{margin-top:10px;border:1px dashed #c9a24a;border-radius:10px;padding:6px 10px;background:#fffaf0}.nf-key summary{cursor:pointer;font-weight:600;color:#6b4e00}
