/* Support chat component. Used by the mobile app, the desktop site and the staff console. */
.sc {
    --sc-bg: #111414; --sc-surface: #1d2121; --sc-surface-2: #262b2b; --sc-line: #2b3131;
    --sc-text: #ededed; --sc-mute: #9aa1a1; --sc-faint: #6f7676;
    --sc-mine: #11a642; --sc-mine-text: #ffffff; --sc-accent: #7df27d; --sc-read: #7df27d;
    --sc-danger: #e52f6c; --sc-warn: #fcd116; --sc-shadow: 0 8px 28px rgba(0,0,0,.35);
    position: relative; display: flex; flex-direction: column; height: 100%; min-height: 0;
    background: var(--sc-bg); color: var(--sc-text); font: 14px/1.45 "HarmonyOS Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
.sc.sc-light {
    --sc-bg: #f6f7f7; --sc-surface: #ffffff; --sc-surface-2: #eef0f0; --sc-line: #e3e6e6;
    --sc-text: #1c1c1c; --sc-mute: #5f6666; --sc-faint: #9aa0a0;
    --sc-mine: #11a642; --sc-mine-text: #ffffff; --sc-accent: #0e8a38; --sc-read: #0e8a38; --sc-shadow: 0 8px 28px rgba(0,0,0,.12);
}
.sc.sc-white {
    --sc-bg: #ffffff; --sc-surface: #ffffff; --sc-surface-2: #f1f3f4; --sc-line: #e6e8ea;
    --sc-text: #1c1c1c; --sc-mute: #5f6666; --sc-faint: #9aa0a0;
    --sc-accent: #0e8a38; --sc-read: #0e8a38; --sc-shadow: 0 8px 28px rgba(0,0,0,.12);
}
.sc.sc-white .sc-row:not(.mine) .sc-bubble, .sc.sc-white .sc-typing .sc-bubble { background: #f1f3f4; box-shadow: none; }
.sc.sc-white .sc-row:not(.mine) .sc-file { background: #e6e9eb; }
.sc.sc-white .sc-av .sc-dot { border-color: #ffffff; }
.sc * { box-sizing: border-box; }
.sc button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }

.sc-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--sc-surface); border-bottom: 1px solid var(--sc-line); }
.sc-av { position: relative; width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; color: #0d2a12;
    background: linear-gradient(135deg, #7df27d, #11a642); }
.sc-av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.sc-av .sc-dot { position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--sc-surface); background: var(--sc-faint); }
.sc-av .sc-dot.on { background: #22c55e; }
.sc-head-text { flex: 1; min-width: 0; }
.sc-head-text b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-head-text small { display: block; color: var(--sc-mute); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-head-actions { display: flex; gap: 8px; align-items: center; }
.sc-chip { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--sc-surface-2); color: var(--sc-mute); text-transform: uppercase; letter-spacing: .3px; }
.sc-chip.open { background: rgba(17,166,66,.16); color: var(--sc-accent); }
.sc-chip.resolved { background: rgba(154,161,161,.18); color: var(--sc-mute); }
.sc-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px; background: var(--sc-surface-2); font-size: 13px; font-weight: 600; }
.sc-btn.primary { background: var(--sc-mine); color: #fff; }
.sc-btn:disabled { opacity: .5; cursor: default; }

.sc-list { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 12px 8px; scroll-behavior: smooth; overscroll-behavior: contain; }
.sc-day { text-align: center; margin: 14px 0 10px; }
.sc-day span { font-size: 11px; color: var(--sc-mute); background: var(--sc-surface-2); padding: 3px 10px; border-radius: 999px; }
.sc-row { display: flex; gap: 8px; margin: 2px 0; align-items: flex-end; }
.sc-row.mine { justify-content: flex-end; }
.sc-mini { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #0d2a12; background: linear-gradient(135deg, #7df27d, #11a642); }
.sc-row .sc-mini { visibility: hidden; }
.sc-row.first .sc-mini { visibility: visible; }
.sc-row.mine .sc-mini { display: none; }
.sc-bubble { max-width: min(78%, 520px); padding: 8px 11px 6px; border-radius: 16px; background: var(--sc-surface); box-shadow: 0 1px 1px rgba(0,0,0,.08); word-wrap: break-word; overflow-wrap: anywhere; }
.sc-row:not(.mine) .sc-bubble { border-bottom-left-radius: 6px; }
.sc-row.mine .sc-bubble { background: var(--sc-mine); color: var(--sc-mine-text); border-bottom-right-radius: 6px; }
.sc-row.gap { margin-top: 10px; }
.sc-name { display: block; font-size: 11px; font-weight: 700; color: var(--sc-accent); margin-bottom: 2px; }
.sc-text { white-space: pre-wrap; }
.sc-text a { color: inherit; text-decoration: underline; }
.sc-meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin-top: 2px; font-size: 10.5px; opacity: .72; }
.sc-tick { font-size: 12px; letter-spacing: -3px; }
.sc-row.mine .sc-tick.read { color: #d9ffe0; opacity: 1; }
.sc-row.pending .sc-bubble { opacity: .7; }
.sc-row.failed .sc-bubble { background: var(--sc-danger); }
.sc-retry { font-size: 11px; text-decoration: underline; margin-left: 6px; }
.sc-progress { height: 3px; border-radius: 2px; background: rgba(255,255,255,.3); margin-top: 6px; overflow: hidden; }
.sc-progress i { display: block; height: 100%; width: 0; background: #fff; transition: width .15s; }

.sc-img { display: block; margin: 2px -5px 4px; border-radius: 12px; overflow: hidden; max-width: 260px; cursor: zoom-in; background: rgba(0,0,0,.15); }
.sc-img img { display: block; width: 100%; max-height: 300px; object-fit: cover; }
.sc-file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 2px -3px 4px; border-radius: 10px; background: rgba(0,0,0,.12); color: inherit; text-decoration: none; min-width: 200px; }
.sc-row:not(.mine) .sc-file { background: var(--sc-surface-2); }
.sc-file-ic { width: 36px; height: 40px; flex: none; border-radius: 6px; display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #fff; background: #e5484d; }
.sc-file b { display: block; font-size: 13px; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-file small { font-size: 11px; opacity: .75; }

.sc-system { text-align: center; margin: 12px 18px; font-size: 12px; color: var(--sc-mute); }
.sc-system span { display: inline-block; padding: 6px 12px; border-radius: 10px; background: var(--sc-surface-2); }
.sc-typing { display: none; gap: 8px; align-items: flex-end; margin: 6px 0 2px; }
.sc-typing.on { display: flex; }
.sc-typing .sc-bubble { padding: 10px 12px; }
.sc-typing i { display: inline-block; width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: var(--sc-mute); animation: sc-bounce 1.2s infinite ease-in-out; }
.sc-typing i:nth-child(2) { animation-delay: .15s; }
.sc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes sc-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.sc-panel { margin: 6px 12px 10px; padding: 12px; border-radius: 14px; background: var(--sc-surface); border: 1px solid var(--sc-line); }
.sc-panel p { margin: 0 0 10px; font-size: 13px; color: var(--sc-mute); }
.sc-topics { display: flex; flex-wrap: wrap; gap: 8px; }
.sc-topics button { padding: 7px 12px; border-radius: 999px; background: var(--sc-surface-2); font-size: 13px; border: 1px solid transparent; }
.sc-topics button:hover, .sc-topics button.on { border-color: var(--sc-accent); color: var(--sc-accent); }
.sc-stars { display: flex; gap: 6px; }
.sc-stars button { font-size: 26px; line-height: 1; color: var(--sc-faint); transition: transform .1s; }
.sc-stars button.on, .sc-stars button:hover { color: #fcd116; transform: scale(1.08); }

.sc-quick { display: flex; gap: 8px; overflow-x: auto; padding: 8px 12px 0; scrollbar-width: none; }
.sc-quick::-webkit-scrollbar { display: none; }
.sc-quick button { flex: none; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; padding: 6px 10px; border-radius: 999px; background: var(--sc-surface-2); border: 1px solid var(--sc-line); }
.sc-quick button:hover { border-color: var(--sc-accent); }

.sc-compose { padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: var(--sc-surface); border-top: 1px solid var(--sc-line); }
.sc-attachment { display: none; align-items: center; gap: 10px; margin: 0 2px 8px; padding: 6px 8px; border-radius: 10px; background: var(--sc-surface-2); font-size: 12px; }
.sc-attachment.on { display: flex; }
.sc-attachment img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.sc-attachment .sc-file-ic { width: 32px; height: 36px; }
.sc-attachment span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-attachment button { font-size: 18px; color: var(--sc-mute); padding: 0 4px; }
.sc-bar { display: flex; align-items: flex-end; gap: 8px; }
.sc-icon { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; color: var(--sc-mute); }
.sc-icon:hover { background: var(--sc-surface-2); color: var(--sc-text); }
.sc-icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sc-input, .sc textarea.sc-input { flex: 1; min-width: 0; min-height: 38px; max-height: 140px; resize: none; border: 1px solid var(--sc-line); border-radius: 20px; padding: 9px 14px; background: var(--sc-bg); color: var(--sc-text); font: inherit; outline: none; line-height: 1.35; }
.sc-input:focus, .sc textarea.sc-input:focus { border-color: var(--sc-accent); }
.sc-send { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--sc-mine); color: #fff; transition: transform .1s, opacity .1s; }
.sc-send:disabled { opacity: .45; cursor: default; }
.sc-send:not(:disabled):active { transform: scale(.92); }
.sc-send svg { width: 20px; height: 20px; fill: currentColor; }
.sc-hint { font-size: 11px; color: var(--sc-faint); margin: 6px 4px 0; }

.sc-drop { position: absolute; inset: 0; z-index: 5; display: none; place-items: center; background: rgba(17,166,66,.12); border: 2px dashed var(--sc-accent); border-radius: 12px; font-weight: 700; color: var(--sc-accent); }
.sc-drop.on { display: grid; }
.sc-lightbox { position: fixed; inset: 0; z-index: 9999; display: none; place-items: center; background: rgba(0,0,0,.9); padding: 20px; cursor: zoom-out; }
.sc-lightbox.on { display: grid; }
.sc-lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: var(--sc-shadow); }
.sc-lightbox a { position: absolute; top: 16px; right: 18px; color: #fff; font-size: 13px; text-decoration: underline; }
.sc-empty-staff { margin: auto; text-align: center; color: var(--sc-mute); padding: 40px 20px; }
.sc-toast { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); background: rgba(20,20,20,.92); color: #fff; padding: 8px 14px; border-radius: 8px; font-size: 13px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 6; max-width: 90%; text-align: center; }
.sc-toast.on { opacity: 1; }
