/* Customer conversations: quiet surfaces, clear reading and touch targets.
   Merchant branding remains in the logo, message color and primary action. */
.vc-page { min-height: 100vh; background: var(--bg); }
.vc-shell { width: 100%; max-width: 960px; margin: 0 auto; height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: var(--panel-2); }
.vc-header { display: flex; align-items: center; gap: 12px; flex: none; padding: 16px 24px; padding-top: max(16px, env(safe-area-inset-top)); background: var(--panel); border-bottom: 1px solid var(--line); }
.vc-back { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 44px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--brand); font-size: 13px; font-weight: 600; text-decoration: none; }
.vc-back::before { content: ''; width: 6px; height: 6px; border: solid currentColor; border-width: 0 0 1.5px 1.5px; transform: rotate(45deg); }
.vc-back:hover { background: var(--panel-2); }
.vc-logo { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; background: var(--panel-2); flex: none; }
.vc-title { flex: 1; min-width: 0; }
.vc-title h1 { margin: 0; font-size: 16px; font-weight: 600; line-height: 24px; overflow-wrap: anywhere; }
.vc-status { margin: 4px 0 0; font-size: 12px; line-height: 16px; color: var(--muted); overflow-wrap: anywhere; }
.vc-status::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin: 0 6px 1px 0; background: #9aa29d; }
.vc-status.on::before { background: var(--brand); }
.vc-language { flex: none; color: var(--muted); font-size: 13px; }
.vc-identity { flex: none; margin: 0; padding: 8px 24px; font-size: 12px; line-height: 20px; color: var(--muted); background: var(--panel); border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.vc-notice { flex: none; margin: 0; padding: 12px 24px; font-size: 13px; background: var(--danger-soft); color: var(--danger); overflow-wrap: anywhere; }
.vc-messages { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; padding: 24px; display: flex; flex-direction: column; gap: 20px; scrollbar-width: thin; scrollbar-color: #c9ceca transparent; }
.vc-msg { max-width: min(84%, 640px); min-width: 0; display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: start; gap: 8px; align-self: flex-start; }
.vc-msg-content { display: grid; gap: 4px; min-width: 0; }
.vc-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--panel); }
.vc-msg .vc-bubble { padding: 12px 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 15px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.vc-msg.mine { align-self: flex-end; grid-template-columns: minmax(0, 1fr) 36px; }
.vc-msg.mine .vc-avatar { grid-column: 2; grid-row: 1; }
.vc-msg.mine .vc-msg-content { grid-column: 1; grid-row: 1; }
.vc-msg.mine .vc-bubble { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); border-top-right-radius: 4px; }
.vc-msg.from-staff .vc-bubble, .vc-msg.from-system .vc-bubble { border-top-left-radius: 4px; }
.vc-msg.from-system { align-self: flex-start; }
.vc-msg.from-system .vc-bubble { background: var(--panel); }
.vc-msg .vc-meta { font-size: 12px; line-height: 16px; color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.vc-msg.mine .vc-meta { text-align: right; }
.vc-bubble img { max-width: min(260px, 100%); max-height: 320px; border-radius: 8px; display: block; cursor: zoom-in; }
.vc-msg .vc-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.vc-chip { min-height: 44px; max-width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--panel); font-size: 13px; line-height: 20px; text-align: left; overflow-wrap: anywhere; cursor: pointer; transition: background-color 120ms var(--ease), border-color 120ms var(--ease); }
.vc-chip:hover { background: var(--panel-2); border-color: #b4bdb7; }
.vc-chip:active { border-color: var(--brand); }
.vc-welcome { align-self: center; padding: 0 16px 4px; text-align: center; color: var(--muted); font-size: 12px; line-height: 20px; max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }
.vc-help { flex: none; padding: 12px 24px; border-top: 1px solid var(--line); background: var(--panel); }
.vc-help h2 { margin: 0 0 8px; color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 400; }
.vc-faq { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
.vc-faq .vc-chip { flex: none; max-width: min(280px, 88%); }
.vc-compose { flex: none; background: var(--panel); border-top: 1px solid var(--line); padding: 16px 24px 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); display: grid; gap: 8px; }
.vc-input-row { display: flex; gap: 8px; align-items: flex-end; min-width: 0; }
.vc-input-row textarea { flex: 1; min-width: 0; width: 100%; resize: none; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 44px; max-height: 140px; background: var(--panel); font-size: 16px; line-height: 22px; }
.vc-input-row textarea::placeholder { color: var(--muted); }
.vc-icon { width: 44px; height: 44px; flex: none; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.vc-icon:hover { background: var(--panel-2); color: var(--ink); }
.vc-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
#vc-send { min-height: 44px; min-width: 72px; flex: none; padding: 8px 16px; font-size: 14px; font-weight: 500; border-radius: 8px; }
.vc-foot { display: flex; flex-wrap: wrap; gap: 0 8px; align-items: center; min-width: 0; }
.vc-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; line-height: 20px; }
.vc-link:hover { background: var(--panel-2); color: var(--ink); }
#vc-human { max-width: 64%; margin-left: -8px; color: var(--brand); font-weight: 500; text-align: left; }
#vc-leave { margin-right: -8px; }
#vc-send-status { order: 3; width: 100%; padding: 0 0 8px; font-size: 12px; line-height: 20px; overflow-wrap: anywhere; }
#vc-send-status:empty { display: none; }
#vc-older { align-self: center; }
.vc-pending { display: flex; gap: 12px; align-items: center; padding: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.vc-pending img { width: 48px; height: 48px; flex: none; object-fit: cover; border-radius: 4px; }
#vc-pending-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
#vc-pending-remove { width: 44px; height: 44px; flex: none; padding: 0; font-size: 20px; background: var(--panel); }
#vc-image-full { max-width: 100%; max-height: 75vh; display: block; margin: 0 auto 16px; }
#vc-image-dialog form { display: flex; justify-content: flex-end; }
#vc-image-close { min-height: 44px; min-width: 72px; }
.vc-page :focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.vc-messages:focus-visible { outline-offset: -3px; }
@media (min-width: 800px) and (min-height: 600px) {
  .vc-shell { height: calc(100vh - 48px); height: calc(100dvh - 48px); margin: 24px auto; border: 1px solid var(--line); border-radius: 12px; }
}
@media (max-width: 640px) {
  .vc-header { padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); gap: 8px; }
  .vc-logo { width: 40px; height: 40px; border-radius: 8px; }
  .vc-title h1 { font-size: 15px; line-height: 20px; }
  .vc-identity, .vc-notice { padding-left: 16px; padding-right: 16px; }
  .vc-messages { padding: 20px 16px; gap: 16px; }
  .vc-msg { max-width: 96%; grid-template-columns: 32px minmax(0, 1fr); }
  .vc-msg.mine { grid-template-columns: minmax(0, 1fr) 32px; }
  .vc-avatar { width: 32px; height: 32px; }
  .vc-msg .vc-bubble { padding: 10px 12px; }
  .vc-help { padding: 12px 16px 8px; }
  .vc-compose { padding: 12px 12px 4px; padding-bottom: max(4px, env(safe-area-inset-bottom)); }
  #vc-send { min-width: 64px; padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 360px) {
  .vc-header { padding-left: 12px; padding-right: 12px; }
  .vc-messages { padding-left: 12px; padding-right: 12px; }
  .vc-msg { max-width: 100%; }
  .vc-help { padding-left: 12px; padding-right: 12px; }
  .vc-foot { gap: 0 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .vc-chip { transition: none; }
}
