/* Support messages page (support.php on both sites).

   CANONICAL COPY. getcoinsWebsite/styles/support-chat.css must be
   byte-identical (docs/support-chat/syncGetcoinsCopy.php --check).

   Uses the FC theme tokens from
   styles/fc-theme.css on getcoins; every rule is scoped to .sc-app / .sc-page so no other
   page changes. The conversation reuses the fb-* bubble structure of the 2306
   report thread (shared engine js/supportChatLive.js) in this site's colours. */

/* Theme tokens. Defaults are the UT Coins (getcoins) colours; another site
   overrides them on its own wrapper (2306: .sc-theme-ft in support.php). */
.sc-page, .sc-app {
    --sc-text: var(--fc-chalk, #e7e7e3);
    --sc-strong: #fff;
    --sc-muted: var(--fc-muted, #b1b8b4);
    --sc-surface: var(--fc-surface, #161818);
    --sc-surface2: var(--fc-surface2, #202323);
    --sc-field: var(--fc-black, #0b0c0c);
    --sc-line: var(--fc-line, rgba(255,255,255,.08));
    --sc-line-field: var(--fc-line, rgba(255,255,255,.12));
    --sc-line-strong: var(--fc-line, rgba(255,255,255,.18));
    --sc-accent: var(--fc-green, #07f468);
    --sc-accent-hover: #52f892;
    --sc-accent-ink: #04140b;
    --sc-mine: #1f3d2b;
    --sc-error: #ffb199;
    --sc-notice-ink: #ffd2c2;
    --sc-notice-line: rgba(255, 138, 101, .45);
    --sc-notice-bg: rgba(255, 138, 101, .08);
    --sc-status-new: #9ec5ff;
    --sc-status-progress: #ffd479;
    --sc-chip: rgba(255,255,255,.08);
    --sc-chip-strong: rgba(255,255,255,.14);
}


.sc-page { padding-bottom: 60px; }
.sc-app { max-width: 820px; margin: 0 auto 40px; color: var(--sc-text); }
.sc-unavailable { max-width: 820px; margin: 0 auto 40px; }

.sc-intro { margin: 0 0 18px; text-align: center; color: var(--sc-muted); font-size: 15px; }
.sc-muted { margin: 0; color: var(--sc-muted); font-size: 14px; }
.sc-muted a, .sc-notice a { color: var(--sc-accent); }

.sc-card {
    background: var(--sc-surface);
    border: 1px solid var(--sc-line);
    border-radius: 12px;
    padding: 22px 24px;
}

.sc-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sc-title { margin: 0; color: var(--sc-strong); font-size: 19px; font-weight: 800; }

.sc-notice {
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--sc-notice-line);
    background: var(--sc-notice-bg);
    color: var(--sc-notice-ink);
    font-size: 14px;
}

.sc-btn, .sc-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 4px;
    font-weight: 800;
    font-size: 14px;
    text-transform: uppercase;
    cursor: pointer;
}
.sc-btn { background: var(--sc-accent); color: var(--sc-accent-ink); border: 0; }
.sc-btn:hover { background: var(--sc-accent-hover); }
.sc-btn[disabled] { opacity: .6; cursor: progress; }
.sc-btn-secondary { background: transparent; color: var(--sc-text); border: 1px solid var(--sc-line-strong); }
.sc-btn-secondary:hover { border-color: var(--sc-accent); color: var(--sc-strong); }
.sc-btn:focus-visible, .sc-btn-secondary:focus-visible, .sc-item-link:focus-visible, .sc-back:focus-visible,
.sc-textarea:focus-visible, .sc-app .fb-composer-input:focus-visible {
    outline: 3px solid var(--sc-text);
    outline-offset: 3px;
}

.sc-new { margin: 0 0 18px; padding: 16px; border-radius: 10px; background: var(--sc-surface2); }
.sc-label { display: block; margin-bottom: 8px; color: var(--sc-strong); font-weight: 700; font-size: 14px; }
.sc-textarea, .sc-app .fb-composer-input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--sc-line-field);
    background: var(--sc-field);
    color: var(--sc-strong);
    font-size: 15px;
    resize: vertical;
}
.sc-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.sc-hint { margin: 6px 0 0; min-height: 1.2em; color: var(--sc-muted); font-size: 13px; flex: 1 1 100%; }
.sc-hint[data-error] { color: var(--sc-error); }

.sc-list { list-style: none; margin: 0; padding: 0; }
.sc-item + .sc-item { border-top: 1px solid var(--sc-line); }
.sc-item-link {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    padding: 14px 4px;
    min-height: 44px;
    color: var(--sc-text);
    text-decoration: none;
}
.sc-item-link:hover { color: var(--sc-strong); text-decoration: none; }
.sc-item-subject { flex: 1 1 260px; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-item-unread .sc-item-subject { color: var(--sc-strong); }
.sc-item-meta { color: var(--sc-muted); font-size: 13px; }
.sc-item-new {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--sc-accent);
    color: var(--sc-accent-ink);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}
#scListMore { margin-top: 12px; }

.sc-thread { padding: 0; overflow: hidden; }
.sc-thread-head { padding: 18px 24px 14px; border-bottom: 1px solid var(--sc-line); }
.sc-thread-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; }
.sc-back { color: var(--sc-muted); font-size: 13px; font-weight: 700; }
.sc-back:hover { color: var(--sc-accent); text-decoration: none; }
.sc-earlier { margin: 14px 24px 0; }

/* Status pill (same names as the 2306 thread header). */
.sc-app .fb-status-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 700;
    background: var(--sc-chip); color: var(--sc-text);
}
.sc-app .fb-status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sc-app .fb-status-pill-new { color: var(--sc-status-new); }
.sc-app .fb-status-pill-in_progress { color: var(--sc-status-progress); }
.sc-app .fb-status-pill-closed { color: var(--sc-muted); }
.sc-app .fb-status-pill > span { color: inherit; }

/* Conversation */
.sc-app .fb-conversation { display: flex; flex-direction: column; gap: 16px; padding: 20px 24px; }
.sc-app .fb-day { display: flex; align-items: center; gap: 12px; }
.sc-app .fb-day-line { flex: 1 1 0; height: 1px; background: var(--sc-line); }
.sc-app .fb-day-label { font-size: 11.5px; font-weight: 700; color: var(--sc-muted); }
.sc-app .fb-bubble-row { display: flex; align-items: flex-start; gap: 10px; }
.sc-app .fb-bubble-row-right { justify-content: flex-end; }
.sc-app .fb-bubble-col { display: flex; flex-direction: column; gap: 4px; max-width: min(560px, 80%); }
.sc-app .fb-bubble-row-right .fb-bubble-col { align-items: flex-end; }
.sc-app .fb-avatar {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%;
    font-size: 10.5px; font-weight: 800;
    background: var(--sc-surface2); color: var(--sc-text);
}
.sc-app .fb-avatar-team { background: var(--sc-accent); color: var(--sc-accent-ink); }
.sc-app .fb-bubble { padding: 10px 14px; border-radius: 14px; word-break: break-word; overflow-wrap: anywhere; }
.sc-app .fb-bubble-row-left .fb-bubble { background: var(--sc-surface2); color: var(--sc-text); border-top-left-radius: 4px; }
.sc-app .fb-bubble-row-right .fb-bubble { background: var(--sc-mine); color: var(--sc-strong); border-top-right-radius: 4px; }
.sc-app .fb-bubble-text { margin: 0; font-size: 15px; line-height: 1.5; color: inherit; }
.sc-app .fb-bubble a.fb-link { color: var(--sc-accent); text-decoration: underline; }
.sc-app .fb-bubble-meta { margin: 0; font-size: 12px; color: var(--sc-muted); }
.sc-app .fb-bubble-row-right .fb-bubble-meta { text-align: right; }
.sc-app .fb-bubble-pending { opacity: .7; }
.sc-app .fb-thread-empty { margin: 0; font-size: 13px; color: var(--sc-muted); }

.sc-app .fb-live-state { margin: 0; padding: 0 24px 6px; min-height: 1.5em; font-size: 12.5px; color: var(--sc-muted); }
.sc-app .fb-live-state[data-state="reconnecting"],
.sc-app .fb-live-state[data-state="offline"],
.sc-app .fb-live-state[data-state="signedout"],
.sc-app .fb-live-state[data-state="expired"],
.sc-app .fb-live-state[data-state="notfound"] { color: var(--sc-error); font-weight: 700; }

.sc-app .fb-composer {
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px;
    margin: 0; padding: 14px 24px 16px;
    background: var(--sc-field);
    border-top: 1px solid var(--sc-line);
}
.sc-app .fb-composer-input { flex: 1 1 240px; width: auto; }

/* Classification first, then the message (support.php new-message form). */
.sc-fieldset { min-width: 0; margin: 0 0 14px; padding: 0; border: 0; }
.sc-fieldset[disabled] { opacity: .55; }
.sc-step { float: left; width: 100%; margin: 0 0 10px; padding: 0; color: var(--sc-strong); font-size: 15px; font-weight: 800; }
.sc-step + * { clear: both; }
.sc-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.sc-choice {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 44px; padding: 0 16px; border-radius: 8px;
    border: 1px solid var(--sc-line-strong);
    background: var(--sc-field); color: var(--sc-text);
    font-weight: 700; cursor: pointer;
}
.sc-app .sc-choice span { color: var(--sc-text); }
.sc-choice:has(input:checked) { border-color: var(--sc-accent); }
.sc-app .sc-choice:has(input:checked) span { color: var(--sc-strong); }
.sc-choice input { accent-color: var(--sc-accent); }
.sc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.sc-field { min-width: 0; }
.sc-optional { color: var(--sc-muted); font-weight: 400; }
.sc-select, .sc-input {
    width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 8px;
    border: 1px solid var(--sc-line-field);
    background: var(--sc-field); color: var(--sc-strong); font-size: 15px;
}
.sc-select:focus-visible, .sc-input:focus-visible, .sc-choice:focus-within, .sc-attach:focus-within,
.sc-attach-plus:focus-within, .sc-link-button:focus-visible {
    outline: 3px solid var(--sc-text);
    outline-offset: 3px;
}
.sc-files { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; }
.sc-attach { min-height: 40px; }
.sc-file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sc-files-hint { font-size: 13px; }
.sc-file-list { flex: 1 1 100%; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.sc-file-item {
    display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
    padding: 4px 6px 4px 10px; border-radius: 6px; background: var(--sc-surface2); font-size: 13px;
}
.sc-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.sc-link-button {
    padding: 4px 6px; border: 0; background: transparent;
    color: var(--sc-accent); font-weight: 700; font-size: 13px; text-decoration: underline; cursor: pointer;
}
.sc-category { margin: 8px 0 0; color: var(--sc-text); font-size: 13px; font-weight: 700; }
.sc-order-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; color: var(--sc-muted); font-size: 13px; }
.sc-order-line strong { color: var(--sc-strong); font-variant-numeric: tabular-nums; }
.sc-order-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1 1 100%; }
.sc-order-form .sc-input { max-width: 300px; }
.sc-attach-plus {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; flex: 0 0 auto; border-radius: 8px; cursor: pointer;
    border: 1px solid var(--sc-line-strong); color: var(--sc-text); font-size: 22px; font-weight: 700;
}
.sc-attach-plus:hover { border-color: var(--sc-accent); color: var(--sc-strong); }

/* Inline images in the conversation (same markup as the 2306 thread). */
.sc-app .fb-bubble-files { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 8px; }
.sc-app .fb-attach-image { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: 100%; }
.sc-app .fb-attach-thumb { display: inline-block; max-width: 100%; border-radius: 8px; overflow: hidden; line-height: 0; background: var(--sc-field); }
.sc-app .fb-attach-thumb:focus-visible { outline: 3px solid var(--sc-text); outline-offset: 2px; }
.sc-app .fb-attach-img { display: block; max-width: 260px; max-height: 200px; width: auto; height: auto; object-fit: contain; }
.sc-app .fb-attach-thumb.fb-thumb-failed {
    display: inline-flex; align-items: center; justify-content: center; min-width: 140px; min-height: 56px;
    padding: 10px 14px; line-height: 1.3; border: 1px dashed currentColor;
}
.sc-app .fb-thumb-failed .fb-attach-img { display: none; }
.sc-app .fb-thumb-fallback { font-size: 12px; font-weight: 700; text-decoration: underline; }
.sc-app .fb-thumb-note { margin: 0; font-size: 12px; line-height: 1.4; color: inherit; opacity: .85; }
.sc-app .fb-thumb-retry {
    margin-left: 4px; padding: 2px 8px; border: 1px solid currentColor; border-radius: 6px;
    background: transparent; color: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}
.sc-app .fb-attach-chip a { color: inherit; }
.sc-app a.fb-attach-name { text-decoration: none; }
.sc-app a.fb-attach-name:hover, .sc-app a.fb-attach-name:focus-visible { text-decoration: underline; }
.sc-app .fb-attach-chip {
    display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
    padding: 6px 10px 6px 8px; border-radius: 8px;
    background: var(--sc-chip); color: inherit; text-decoration: none; font-size: 12px;
}
.sc-app .fb-attach-type { padding: 2px 5px; border-radius: 4px; background: var(--sc-chip-strong); font-size: 9px; font-weight: 800; }
.sc-app .fb-attach-name { font-weight: 700; overflow-wrap: anywhere; }
.sc-app .fb-attach-dl { text-decoration: underline; font-weight: 600; }
.sc-app .fb-attach-type, .sc-app .fb-attach-dl { flex: 0 0 auto; white-space: nowrap; }
/* The theme colours bare spans dark; keep the support texts readable. */
.sc-app .sc-item-subject { color: var(--sc-text); }
.sc-app .sc-item-unread .sc-item-subject { color: var(--sc-strong); }
.sc-app .sc-order-line span { color: var(--sc-muted); }
.sc-app .sc-attach-plus span { color: var(--sc-text); }
.sc-app .fb-attach-chip span, .sc-app .fb-thumb-fallback { color: inherit; }

/* Guest visitors: what the chat keeps, said plainly (support.php). */
.sc-guest-note {
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--sc-line-strong);
    background: var(--sc-surface);
    color: var(--sc-text);
    font-size: 14px;
}
.sc-guest-note p { margin: 0; color: inherit; }
.sc-guest-note p + p { margin-top: 6px; }
.sc-guest-note strong { color: var(--sc-strong); }
.sc-guest-note a { color: var(--sc-accent); font-weight: 700; text-decoration: underline; }
.sc-app .fb-live-state[data-state="switched"],
.sc-app .fb-live-state[data-state="guestlost"] { color: var(--sc-error); font-weight: 700; }

@media (max-width: 575.98px) {
    .sc-card { padding: 16px; border-radius: 10px; }
    .sc-thread { padding: 0; }
    .sc-thread-head, .sc-app .fb-conversation, .sc-app .fb-composer { padding-left: 14px; padding-right: 14px; }
    .sc-app .fb-live-state { padding-left: 14px; padding-right: 14px; }
    .sc-earlier { margin: 12px 14px 0; }
    .sc-app .fb-bubble-col { max-width: 86%; }
    .sc-card-head { flex-wrap: wrap; }
    .sc-app .fb-composer .sc-btn { flex: 1 1 100%; }
    .sc-grid { grid-template-columns: minmax(0, 1fr); }
    .sc-app .fb-attach-img { max-width: 200px; }
}
@media (prefers-reduced-motion: reduce) {
    .sc-app * { transition: none !important; }
}
