/* ---------- Support chat (bottom right, js/views/support.js) ---------- */
.sup { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.sup-fab { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 20px 0 16px; border: 0; cursor: pointer; color: #fff;
  background: var(--grad-brand); box-shadow: 0 10px 30px rgba(147, 51, 234, .45); font-family: var(--font-display); font-weight: 700; font-size: 13px;
  letter-spacing: .12em; text-transform: uppercase; transition: transform .2s var(--ease); }
.sup-fab:hover { transform: translate3d(0, -3px, 0); }
.sup-fab svg { width: 22px; height: 22px; }
.sup.is-open .sup-fab span { display: none; }

.sup-panel { width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 120px)); display: flex; flex-direction: column; overflow: hidden;
  background: #0d0716; border: 1px solid var(--line-strong); box-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 0 40px rgba(147, 51, 234, .18); }
.sup-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(120deg, #1a0b2e, #0d0716 70%); }
.sup-title { flex: 1; min-width: 0; font-family: var(--font-display); font-weight: 700; font-size: 14px; letter-spacing: .06em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sup-icon { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; font-size: 16px; }
.sup-icon:hover { border-color: var(--line-hover); }

.sup-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.sup-new { align-self: stretch; justify-content: center; }
.sup-body > *, .sup-pick > * { flex-shrink: 0; }
.sup-form--new textarea { min-height: 120px; }
.sup-body, .sup-msgs { scrollbar-width: thin; scrollbar-color: rgba(168, 85, 247, .5) transparent; }
.sup-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); margin-top: 6px; }
.sup-hint { font-size: 12px; color: var(--muted); line-height: 1.5; }
.sup-tickets { display: flex; flex-direction: column; gap: 8px; }
.sup-ticket { display: grid; gap: 4px; padding: 12px 14px; text-align: left; cursor: pointer; color: var(--text); border: 1px solid var(--line); background: rgba(20, 11, 34, .6); transition: border-color .2s; }
.sup-ticket:hover { border-color: var(--line-hover); }
.sup-ticket-top { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-mono); font-size: 13px; }
.sup-ticket-script { font-size: 14px; color: var(--text-strong); }
.sup-ticket-time { font-size: 12px; color: var(--muted); }
.sup-badge { padding: 2px 8px; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); }
.sup-badge.is-open { color: #86efac; border-color: rgba(134, 239, 172, .45); }

.sup-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; }
.sup-empty .t { font-family: var(--font-display); font-weight: 700; font-size: 16px; text-transform: uppercase; }
.sup-empty .d { font-size: 14px; color: var(--muted); line-height: 1.5; }

.sup-pick { display: flex; flex-direction: column; gap: 6px; }
.sup-pick-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; cursor: pointer; text-align: left; color: var(--text);
  background: rgba(7, 4, 13, .8); border: 1px solid var(--line); font: inherit; font-size: 14px; transition: border-color .2s; }
.sup-pick-btn:hover, .sup-pick.is-open .sup-pick-btn { border-color: var(--line-hover); }
.sup-pick-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sup-pick-label.is-empty { color: var(--muted); }
.sup-pick-chev { display: grid; place-items: center; color: var(--muted); transition: transform .2s var(--ease); }
.sup-pick.is-open .sup-pick-chev { transform: rotate(180deg); }
.sup-pick-ico { flex: none; width: 28px; height: 26px; display: grid; place-items: center; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 12px;
  background: rgba(168, 85, 247, .25); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }
.sup-pick-list { display: flex; flex-direction: column; max-height: 232px; overflow-y: auto; padding: 4px; border: 1px solid var(--line-strong); background: #0b0614;
  scrollbar-width: thin; scrollbar-color: rgba(168, 85, 247, .5) transparent; }
.sup-pick-opt { display: flex; align-items: center; gap: 10px; padding: 7px 8px; cursor: pointer; text-align: left; color: var(--text); background: transparent; border: 0;
  font: inherit; font-size: 14px; transition: background .15s; }
.sup-pick-opt:hover, .sup-pick-opt:focus-visible { background: rgba(147, 51, 234, .18); outline: none; }
.sup-pick-opt.is-on { background: rgba(147, 51, 234, .3); }
.sup-pick-opt.is-on .sup-pick-ico { background: var(--grad-brand-diag); }
.sup-form select, .sup-form textarea { width: 100%; padding: 10px 12px; color: var(--text); background: rgba(7, 4, 13, .8); border: 1px solid var(--line);
  font: inherit; font-size: 14px; resize: vertical; }
.sup-form select:focus, .sup-form textarea:focus { outline: none; border-color: var(--line-hover); }

.sup-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sup-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.sup-msg { max-width: 85%; align-self: flex-start; display: flex; flex-direction: column; gap: 4px; }
.sup-msg.is-mine { align-self: flex-end; align-items: flex-end; }
.sup-msg-meta { font-size: 11px; color: var(--muted); }
.sup-msg-text { padding: 9px 12px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; background: rgba(30, 16, 50, .9); border: 1px solid var(--line); }
.sup-msg.is-mine .sup-msg-text { background: rgba(147, 51, 234, .28); border-color: rgba(192, 132, 252, .45); }
.sup-sys { align-self: center; padding: 6px 10px; font-size: 12px; color: var(--muted); border: 1px dashed var(--line); text-align: center; }
.sup-form--reply { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.sup-form--reply textarea { resize: none; }
.sup-closed { padding: 12px 14px; font-size: 13px; color: var(--muted); text-align: center; border-top: 1px solid var(--line); }
.sup-error { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; font-size: 13px; color: #fecaca;
  background: rgba(239, 68, 68, .12); border-bottom: 1px solid rgba(239, 68, 68, .35); }
.sup-link { background: none; border: 0; color: #fff; text-decoration: underline; cursor: pointer; font: inherit; }

/* Attachments */
.sup-actions { display: flex; align-items: center; gap: 10px; }
.sup-actions .btn { flex: 1; justify-content: center; }
.sup-reply-row { display: flex; align-items: flex-end; gap: 8px; }
.sup-reply-row textarea { flex: 1; min-height: 40px; max-height: 120px; resize: none; }
.sup-form--reply { flex-direction: column; align-items: stretch; }
.sup-file-input { display: none; }
.sup-attach { flex: none; width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer; color: var(--text);
  border: 1px solid var(--line); background: rgba(7, 4, 13, .8); transition: border-color .2s, color .2s; }
.sup-attach:hover { border-color: var(--line-hover); color: #fff; }
.sup-attach.is-disabled { opacity: .4; pointer-events: none; }
.sup-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sup-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 4px 6px 4px 4px; border: 1px solid var(--line); background: rgba(20, 11, 34, .8); font-size: 12px; }
.sup-chip img, .sup-chip-ico { width: 30px; height: 30px; flex: none; object-fit: cover; display: grid; place-items: center; background: rgba(168, 85, 247, .2);
  font-family: var(--font-mono); font-size: 9px; color: var(--lilac); }
.sup-chip-name { max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sup-chip-size { color: var(--muted); }
.sup-chip-x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 12px; padding: 2px 4px; }
.sup-chip-x:hover { color: #fff; }
.sup-msg-files { display: flex; flex-direction: column; gap: 6px; }
.sup-msg.is-mine .sup-msg-files { align-items: flex-end; }
.sup-file-img img { display: block; max-width: 240px; max-height: 200px; object-fit: cover; border: 1px solid var(--line); }
.sup-file-video { max-width: 260px; max-height: 200px; border: 1px solid var(--line); background: #000; }
.sup-file { display: inline-block; padding: 6px 10px; font-size: 13px; color: var(--lilac); border: 1px solid var(--line); background: rgba(20, 11, 34, .8); text-decoration: none; }
.sup-file:hover { border-color: var(--line-hover); color: #fff; }
.sup-msg.is-pending { opacity: .65; }
.sup-msg.is-failed .sup-msg-meta { color: #fca5a5; }

@media (max-width: 640px) {
  .sup { right: 12px; bottom: 12px; left: 12px; }
  .sup-panel { width: 100%; height: calc(100vh - 100px); }
  .sup-fab span { display: none; }
  .sup-fab { width: 52px; padding: 0; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .sup-fab { transition: none; } }
