/* Customer and guest conversation shell; protocol and staff panes stay independent. */
.customer {
    --primary: var(--ui-primary); --ink: var(--ui-text); --muted: var(--ui-muted);
    --line: var(--ui-border); --bg: var(--ui-background); --surface: var(--ui-surface);
    --media-accent: var(--ui-primary); --media-soft: var(--ui-primary-soft);
    --media-border: var(--ui-border); --media-ink: var(--ui-text); --media-muted: var(--ui-muted);
    background: var(--ui-background); overflow: hidden;
}
.customer .app { position: fixed; top: var(--visual-top, 0px); left: 0; right: 0; width: 100%; max-width: var(--ui-width); height: var(--visual-height, 100dvh); display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); margin: 0 auto; padding: 20px 24px; background: transparent; }
.customer aside, .customer .tools-drawer { display: none; }
.customer main { min-width: 0; min-height: 0; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--suite-shadow); }
.customer header.ui-header { position: relative; inset: auto; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; min-height: 80px; padding: 14px 20px; background: linear-gradient(115deg, #073b2d, #126548); color: #fff; }
.customer header.ui-header .ui-header-title { display: flex; align-items: center; gap: 10px; min-width: 0; color: #fff; text-align: start; }
.customer header.ui-header .ui-header-title > div { min-width: 0; }
.customer header.ui-header #title { display: block; margin: 0; font-size: 18px; line-height: 1.5; color: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.customer header.ui-header .chat-avatar { display: block; width: 40px; height: 40px; object-fit: cover; flex-shrink: 0; border: 1px solid #ffffff55; border-radius: 14px; }
.customer header.ui-header .header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.customer header.ui-header :is(.ui-icon-button, #openCustomerLanguage) { display: grid; place-items: center; flex-shrink: 0; width: 48px; height: 48px; min-width: 48px; min-height: 48px; padding: 10px; border: 1px solid #ffffff45; border-radius: 14px; background: #ffffff12; color: #fff; }
.customer header.ui-header :is(.ui-icon-button, #openCustomerLanguage) svg { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.customer header.ui-header [hidden] { display: none !important; }
.customer header.ui-header #subtitle .ui-brand-icon { fill: currentColor; stroke: none; }
.customer header.ui-header .ui-icon-button span { display: none; }
.customer header.ui-header #subtitle[aria-disabled="true"] { opacity: .5; cursor: default; }
.customer header.ui-header .ui-icon-button:hover { background: #ffffff26; }
.customer .message-stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 160px); grid-template-rows: auto minmax(0, 1fr); background: var(--bg); }
.customer .history-float { position: static; grid-column: 1; grid-row: 1; width: auto; max-width: none; min-height: 48px; margin: 0; padding: 6px 16px; align-items: center; gap: 6px; background: var(--surface); border-bottom: 1px solid var(--line); }
.customer .history-float #older { min-height: 36px; padding: 4px 0; font-size: 13px; color: var(--primary); }
.customer .message-stage #status { position: static; grid-column: 2; grid-row: 1; display: flex; align-items: center; justify-content: flex-end; max-width: none; padding: 6px 16px 6px 0; background: var(--surface); border-bottom: 1px solid var(--line); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.customer .message-stage #messages { grid-column: 1 / -1; grid-row: 2; min-width: 0; min-height: 0; padding: 20px clamp(16px, 3vw, 36px) 28px; gap: 18px; background: radial-gradient(ellipse at top left, #d9eddf50, transparent 60%), var(--bg); }
.customer .message { max-width: min(88%, 720px); }
.customer .bubble { padding: 12px 16px; border: 1px solid var(--line); border-radius: 18px 18px 18px 5px; background: var(--surface); color: var(--ink); font-size: 16px; line-height: 1.75; box-shadow: 0 3px 12px #073b2d05; }
.customer :is(.own, .message-outgoing) .bubble { border-color: #bad8c5; background: var(--ui-primary-soft); border-radius: 18px 18px 5px 18px; }
.customer .message-recalled .bubble { border-style: dashed; background: transparent; color: var(--muted); }
.customer .meta { font-size: 12px; line-height: 1.6; color: var(--muted); }
.customer .unread-float { padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--primary); background: var(--surface); }
.customer footer { min-width: 0; padding: 12px 20px max(16px, env(safe-area-inset-bottom, 0px)); border-color: var(--line); background: var(--surface); }
.customer .composer-tools { gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.customer .composer-tools button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--ui-primary-soft); color: var(--primary); font-size: 14px; }
.customer .composer-tools svg, .customer #send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.customer #compose { gap: 8px; padding: 6px; border: 1px solid #91ad9e; border-radius: 16px; background: #fff; }
.customer #compose:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px #12654822; }
.customer #text { min-height: 50px; max-height: min(150px, 25dvh); padding: 10px 12px; font-size: 16px; line-height: 1.6; outline-offset: -3px; }
.customer :is(#send, #createCustomer, #claimCustomer) { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; gap: 8px; min-height: 50px; padding: 12px 18px; border: 1px solid #dc7c21; border-radius: 12px; background: var(--suite-accent); color: var(--suite-accent-ink); font-size: 16px; font-weight: 650; }
.customer :is(#send, #createCustomer, #claimCustomer):hover:not(:disabled) { background: #ff9c41; }
.customer #notice { font-size: 14px; color: #983c2e; }
.customer dialog:not(.im-shared-viewer):not(#imageCrop) { color: var(--ink); background: var(--surface); border-color: var(--line); border-radius: 20px; }
.customer dialog:not(.im-shared-viewer):not(#imageCrop)::backdrop { background: #052a2080; }
.customer dialog:not(.im-shared-viewer):not(#imageCrop) .picker-heading { background: var(--ui-primary-soft); border-bottom: 1px solid var(--line); }
.customer dialog:not(.im-shared-viewer):not(#imageCrop) :is(input:not([type=checkbox]), select) { min-height: 48px; border-color: #91ad9e; border-radius: 12px; color: var(--ink); }
.customer dialog:not(.im-shared-viewer):not(#imageCrop) label { color: var(--muted); }
.customer dialog:not(.im-shared-viewer):not(#imageCrop) :is(.settings-note, .translation-switch-row) { border-color: var(--line); background: var(--ui-primary-soft); }
.customer dialog:not(.im-shared-viewer):not(#imageCrop) button.primary { background: var(--suite-accent); border-color: #dc7c21; color: var(--suite-accent-ink); border-radius: 12px; }
.customer :is(.bubble.commerce-card, .linked-item) { border-color: var(--line); background: var(--surface); border-radius: 16px; }
.customer .product-summary .order-name { display: block; -webkit-line-clamp: unset; line-clamp: unset; overflow: visible; white-space: normal; }
.customer .commerce-price { background: var(--ui-primary-soft); }
.customer .message-translation-label { color: var(--muted); }
.customer .chat-image { max-width: min(360px, 100%); }
.customer :is(button, a, textarea, input, select):focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.customer header :is(button, a):focus-visible { outline-color: #ffe1ac; }
@media (max-width: 700px) {
    .customer .app { padding: 0; max-width: none; }
    .customer main { border: 0; border-radius: 0; box-shadow: none; }
    .customer header.ui-header { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 8px; padding: max(8px, env(safe-area-inset-top, 0px)) 8px 8px; min-height: 0; }
    .customer header.ui-header .header-actions { justify-content: flex-end; gap: 6px; }
    .customer header.ui-header #title { font-size: 16px; }
    .customer .message-stage { grid-template-columns: minmax(0, 1fr) minmax(0, 110px); }
    .customer .history-float { padding: 4px 12px; }
    .customer .message-stage #status { padding-right: 12px; }
    .customer .message-stage #messages { padding: 16px 12px 24px; gap: 16px; }
    .customer .message { max-width: 94%; }
    .customer .bubble { padding: 10px 13px; }
    .customer footer { padding: 8px max(12px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
    .customer .composer-tools button { padding: 6px 10px; font-size: 13px; }
    .customer #send { min-width: 64px; padding: 10px; }
    .customer #send svg { display: none; }
}
@media (max-height: 500px) and (min-width: 701px) {
    .customer .app { padding: 0; }
    .customer main { border-radius: 0; }
    .customer header.ui-header { min-height: 60px; padding: 6px 12px; gap: 8px; }
    .customer footer { padding-top: 6px; padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)); }
    .customer .composer-tools { margin-bottom: 6px; }
    .customer .composer-tools button { min-height: 44px; }
}
