/* ═══════════════════════════════════════════════════════════════
   VIEW: ZAMZAM CHAT
   Ported from the prototype: Kimi_Agent_Steelco ai/app/buyer.html
   ═══════════════════════════════════════════════════════════════ */

/* ─── chat ─── */
.chat-shell{
  display:flex;flex-direction:column;height:calc(100vh - 72px - 48px);min-height:480px;
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-card);
  box-shadow:var(--shadow-flat);overflow:hidden;
}
.chat-head{
  display:flex;align-items:center;gap:10px;padding:12px 18px;flex:none;
  background:var(--surface);border-bottom:1px solid var(--border);
}
.chat-head .z-name{font-weight:700;color:var(--heading);font-size:.9375rem;line-height:1.3}
.chat-head .z-role{font-size:.75rem;color:var(--caption);line-height:1.3}
.chat-head .z-meta{flex:1;min-width:0;display:flex;flex-direction:column}
.online-dot{width:8px;height:8px;border-radius:50%;background:var(--success);display:inline-block;margin-inline-start:6px;vertical-align:middle}
.chat-body{flex:1;overflow-y:auto;padding:20px 16px;display:flex;flex-direction:column;gap:14px;background:var(--bg-section)}
html[data-theme="dark"] .chat-body{background:var(--bg)}
.msg-row{display:flex;gap:8px;align-items:flex-end}
.msg-row.buyer{justify-content:flex-start}
.msg-row.zamzam{justify-content:flex-end}
.bubble{max-width:78%;padding:10px 14px;border-radius:12px;font-size:.875rem;line-height:1.7}
.bubble.buyer{background:var(--royal);color:#FFFFFF;border-start-start-radius:4px;box-shadow:var(--shadow-flat)}
html[data-theme="dark"] .bubble.buyer{background:var(--ai-blue)}
.bubble.zamzam{background:var(--surface);color:var(--body);border:1px solid var(--border);border-start-end-radius:4px;box-shadow:var(--shadow-flat)}
.bubble .m-time{display:block;font-size:.625rem;opacity:.65;margin-top:4px;font-family:var(--font-mono);font-variant-numeric:tabular-nums;direction:ltr;text-align:end}
.msg-stack{max-width:78%;display:flex;flex-direction:column;gap:8px}
.msg-stack .bubble{max-width:100%}
/* voice note bubble */
.voice-note{display:flex;align-items:center;gap:10px;min-width:min(280px,100%)}
.vn-play{
  width:44px;height:44px;border-radius:50%;flex:none;
  background:rgba(255,255,255,.16);border:1.5px solid rgba(255,255,255,.55);color:#FFFFFF;
  display:flex;align-items:center;justify-content:center;
}
.vn-play svg{width:16px;height:16px}
.waveform-svg{flex:1;display:block;min-width:130px;height:32px}
.waveform-svg rect{fill:rgba(255,255,255,.78)}
.waveform-svg rect:nth-child(-n+7){fill:#FFFFFF}
.vn-dur{font-family:var(--font-mono);font-variant-numeric:tabular-nums;font-size:.6875rem;direction:ltr;opacity:.8}
.vn-transcript{
  margin-top:8px;padding-top:8px;border-top:1px dashed rgba(255,255,255,.35);
  font-size:.8125rem;line-height:1.7;
}
.vn-transcript .vn-label{font-size:.6875rem;font-weight:600;opacity:.75;display:block}
/* Read-only history: the thread aged past the 24h edit window. Shown as a
   quiet rule rather than a warning — nothing is wrong, the next message simply
   starts a new conversation. */
.chat-divider{
  display:flex;align-items:center;gap:10px;
  margin:6px 0;font-size:.75rem;line-height:1.6;color:var(--caption);text-align:center;
}
.chat-divider::before,.chat-divider::after{
  content:"";flex:1;height:1px;background:var(--border);
}

/* embedded objects in chat */
.chat-card{max-width:min(440px,100%);width:100%}
.sealed-card{
  margin-top:2px;background:var(--surface);border:1.5px solid var(--border-strong);border-radius:var(--radius-card);
  box-shadow:var(--shadow-flat);padding:16px;display:flex;flex-direction:column;gap:10px;
}
.sealed-card .sc-head{display:flex;align-items:center;gap:10px}
.sealed-card .sc-ic{
  width:40px;height:40px;border-radius:10px;flex:none;
  border-radius:50%; overflow:hidden;
  background:var(--navy);color:#FFFFFF;display:flex;align-items:center;justify-content:center;
}
html[data-theme="dark"] .sealed-card .sc-ic{background:var(--raised);color:#F3F5F7}
.sealed-card .sc-ic svg{width:20px;height:20px}
.sealed-card .sc-title{font-weight:700;font-size:.875rem;color:var(--heading)}
.sealed-card .sc-ref{font-family:var(--font-mono);font-variant-numeric:tabular-nums;font-size:.75rem;color:var(--caption);direction:ltr}
.sealed-card .sc-row{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;font-size:.8125rem;color:var(--body)}
.chat-composer{
  flex:none;display:flex;align-items:center;gap:8px;padding:12px 14px;
  background:var(--surface);border-top:1px solid var(--border);
}
.chat-composer .cc-input{
  flex:1;display:flex;align-items:center;min-height:48px;
  border:1px solid var(--border);border-radius:var(--radius-chip);
  background:var(--bg);padding:4px 16px;
}
.chat-composer .cc-input:focus-within{border-color:var(--glow-blue);box-shadow:0 0 0 3px rgba(49,168,255,.16)}
.chat-composer input{flex:1;min-width:0;border:none;background:none;font-family:var(--font-body);font-size:.9375rem;color:var(--heading)}
.chat-composer input:focus{outline:none}
.chat-composer input::placeholder{color:var(--caption)}
@media (max-width:960px){.chat-shell{height:calc(100vh - 72px - 32px)}}

