@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;600;700&display=swap");

:root {
  --ink: #182330;
  --muted: #84919b;
  --line: #e8ecee;
  --canvas: #f6f7f7;
  --coral: #f26f61;
  --coral-pale: #fff0ed;
  --teal: #42af9b;
  --white: #fff;
  font-family: "DM Sans", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--canvas); }
button, input { font: inherit; }
button { cursor: pointer; }

.mobile-app { width: min(100%, 480px); min-height: 100svh; margin: 0 auto; padding-bottom: calc(18px + env(safe-area-inset-bottom)); background: var(--canvas); }
.mobile-header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.brand-line { display: flex; align-items: center; gap: 10px; }.brand-dot { width: 35px; height: 35px; display: grid; place-items: center; color: white; background: var(--coral); border-radius: 10px; font-size: 17px; font-weight: 700; }
.brand-line strong, .brand-line small { display: block; }.brand-line strong { font-size: 14px; }.brand-line small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.online-state { display: inline-flex; align-items: center; gap: 5px; color: var(--teal); font-size: 11px; font-weight: 600; }.online-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px #e5f5f1; }
.welcome-banner { display: flex; align-items: center; gap: 11px; margin: 16px 14px 10px; padding: 13px 14px; color: #6657b8; background: #f0edff; border: 1px solid #e0dbfb; border-radius: 10px; }.banner-icon { width: 29px; height: 29px; display: grid; place-items: center; color: #796bcb; background: white; border-radius: 8px; }.welcome-banner strong { font-size: 12px; }.welcome-banner p { margin: 3px 0 0; color: #8279b6; font-size: 10px; }
.chat-stream { min-height: clamp(400px, 56svh, 600px); padding: 8px 14px 24px; }.date-mark { display: flex; align-items: center; gap: 10px; margin: 12px 0 18px; color: #a8b1b7; font-size: 10px; }.date-mark::before, .date-mark::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.chat-message { display: flex; gap: 8px; align-items: flex-end; margin: 14px 0; }.chat-message.customer { justify-content: flex-end; }.mini-avatar { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; color: white; background: var(--coral); border-radius: 50%; font-size: 10px; font-weight: 700; }.chat-message.customer .mini-avatar { order: 2; background: #6b96cc; }
.message-body { max-width: 82%; }.message-meta { margin: 0 0 4px 2px; color: #a5afb5; font-size: 9px; }.chat-message.customer .message-meta { text-align: right; margin-right: 2px; }.bubble { padding: 10px 11px; color: #394751; background: var(--white); border: 1px solid #edf0f1; border-radius: 4px 12px 12px 12px; box-shadow: 0 2px 7px rgba(30, 49, 63, .03); font-size: 12px; line-height: 1.65; white-space: pre-wrap; }.chat-message.customer .bubble { color: white; background: var(--ink); border-color: var(--ink); border-radius: 12px 4px 12px 12px; }
.typing { display: inline-flex; gap: 3px; padding: 12px 14px; }.typing i { width: 5px; height: 5px; border-radius: 50%; background: #a6afb5; animation: blink 1s infinite; }.typing i:nth-child(2) { animation-delay: .15s; }.typing i:nth-child(3) { animation-delay: .3s; } @keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.lead-card { margin: 8px 14px 12px; padding: 14px; background: white; border: 1px solid #f2c8c2; border-radius: 10px; box-shadow: 0 7px 20px rgba(242, 111, 97, .08); }.lead-card.is-hidden { display: none; }.lead-card-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }.lead-icon { width: 27px; height: 27px; display: grid; place-items: center; color: var(--coral); background: var(--coral-pale); border-radius: 7px; font-size: 16px; }.lead-card-heading strong, .lead-card-heading small { display: block; }.lead-card-heading strong { font-size: 12px; }.lead-card-heading small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.lead-card label { display: block; margin: 9px 0; color: #667580; font-size: 10px; }.lead-card input { width: 100%; margin-top: 5px; padding: 10px; outline: 0; color: var(--ink); background: #f8f9f9; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }.lead-card input:focus { background: white; border-color: var(--coral); }.primary-button { width: 100%; margin-top: 5px; padding: 11px; color: white; background: var(--coral); border: 0; border-radius: 6px; font-size: 12px; font-weight: 700; }.primary-button:active { transform: translateY(1px); }.privacy-note { margin: 8px 0 0; color: #a5afb4; text-align: center; font-size: 9px; }
.confirm-form { padding: 10px; color: #45545e; background: #f8f9f9; border-radius: 7px; font-size: 12px; line-height: 1.9; white-space: pre-line; }.audio-upload-label { display: block; padding: 9px 0; color: #667580; font-size: 10px; }.audio-upload-label input { display: block; width: 100%; margin-top: 5px; font-size: 10px; }.audio-preview { width: 100%; height: 32px; margin: 2px 0 8px; }.audio-preview.is-hidden { display: none; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 8px; margin-top: 5px; }.secondary-button { width: 100%; padding: 11px; color: #65747c; background: #f2f5f5; border: 1px solid #dfe6e7; border-radius: 6px; font-size: 12px; font-weight: 700; }.secondary-button:active { background: #e8eeee; }
.quick-replies { display: flex; gap: 7px; overflow-x: auto; padding: 2px 14px 8px; scrollbar-width: none; }.quick-replies::-webkit-scrollbar { display: none; }.quick-replies button { flex: 0 0 auto; padding: 7px 9px; color: #c15950; background: var(--coral-pale); border: 1px solid #f9d9d4; border-radius: 6px; font-size: 10px; }.quick-replies button:active { background: #ffe1dc; }
.service-entry { display: flex; align-items: center; gap: 7px; padding: 0 14px 10px; color: var(--muted); font-size: 10px; }
.service-entry span { margin-right: 2px; }
.service-entry button { padding: 6px 8px; color: #5c8e86; background: #eaf7f3; border: 1px solid #d5eee8; border-radius: 6px; font-size: 10px; }
.service-entry button:active { background: #d8f0e9; }
.composer-audio { display: grid; place-items: center; width: 34px; height: 40px; color: var(--coral); cursor: pointer; font-size: 17px; }.composer-audio input { display: none; }

@media (min-width: 481px) {
  body { padding: 20px 0; background: #e9edef; }
  .mobile-app { min-height: calc(100vh - 40px); border-radius: 14px; box-shadow: 0 18px 60px rgba(25, 42, 54, .12); overflow: hidden; }
}

@media (max-width: 480px) {
  .chat-stream { min-height: calc(100svh - 255px); }
  .chat-message { margin: 16px 0; }
  .bubble { padding: 11px 13px; font-size: 13px; line-height: 1.7; }
  .composer { min-height: 48px; }
  .composer input { min-height: 40px; }
}
