/* ============================================================
   SUPPORT CENTRE  (support page only)
   Tickets from the Discord bot, shown and answered on the site.
   ============================================================ */

.sc-anchor { scroll-margin-top: calc(var(--nav-h) + 20px); }

.sc-gate {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 22px;
    padding: 26px 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(88, 101, 242, .16), rgba(61, 123, 255, .05) 60%, transparent);
}
.sc-gate .sc-gate-icon {
    width: 56px; height: 56px;
    border-radius: 16px;
    display: grid; place-items: center;
    font-size: 24px; color: #fff;
    background: linear-gradient(135deg, #5865F2, #8b5cf6);
}
.sc-gate h3 { font-size: 19px; font-weight: 750; letter-spacing: -.3px; margin-bottom: 6px; }
.sc-gate p { color: var(--muted); font-size: 14px; max-width: 60ch; }
.sc-gate .sc-gate-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.sc {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: 620px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    overflow: hidden;
}

/* ---- sidebar ---- */
.sc-side {
    border-right: 1px solid var(--line);
    display: flex; flex-direction: column;
    background: var(--bg-2);
    min-width: 0;
}
.sc-me {
    display: flex; align-items: center; gap: 12px;
    padding: 18px 18px 16px;
    border-bottom: 1px solid var(--line);
}
.sc-me img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #5865f2; }
.sc-me b { display: block; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-me span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.sc-me .sc-cust { color: var(--ok); }

.sc-new {
    margin: 14px 14px 6px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 16px;
    border-radius: var(--pill);
    background: var(--accent); color: #fff;
    border: 0; cursor: pointer;
    font: inherit; font-size: 13px; font-weight: 700; letter-spacing: .2px;
    transition: all .15s ease;
}
.sc-new:hover { background: #2f6df0; transform: translateY(-1px); }
.sc-new:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.sc-hint { padding: 4px 18px 8px; font-size: 11.5px; color: var(--dim); }

.sc-group { padding: 10px 10px 6px; }
.sc-group-title {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 8px 8px;
    font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
    color: var(--dim);
}
.sc-group-title em { font-style: normal; color: var(--muted); font-weight: 600; }

.sc-item {
    width: 100%; text-align: left;
    display: grid; grid-template-columns: 1fr auto; gap: 4px 10px;
    padding: 11px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent; color: var(--text);
    cursor: pointer; font: inherit;
    transition: all .12s ease;
}
.sc-item:hover { background: var(--surface-2); }
.sc-item.on { background: var(--surface-2); border-color: var(--line-strong); }
.sc-item b { font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-item small { font-size: 11px; color: var(--dim); white-space: nowrap; }
.sc-item span { grid-column: 1 / -1; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-item .sc-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; background: var(--warn); }
.sc-item .sc-dot.claimed { background: var(--ok); }
.sc-item .sc-dot.closed { background: var(--dim); }
.sc-empty-side { padding: 8px 14px 14px; font-size: 12.5px; color: var(--dim); }

/* ---- main ---- */
.sc-main { display: flex; flex-direction: column; min-width: 0; }

.sc-welcome {
    flex: 1;
    display: grid; place-items: center;
    padding: 40px;
    text-align: center;
}
.sc-welcome i { font-size: 40px; color: var(--accent); margin-bottom: 18px; display: block; }
.sc-welcome h3 { font-size: 22px; font-weight: 800; letter-spacing: -.4px; margin-bottom: 10px; }
.sc-welcome p { color: var(--muted); font-size: 14px; max-width: 46ch; margin: 0 auto 22px; }

.sc-head {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}
.sc-head h3 { font-size: 16px; font-weight: 750; letter-spacing: -.2px; display: flex; align-items: center; gap: 10px; }
.sc-head h3 small { font-family: var(--mono); font-size: 12px; color: var(--dim); font-weight: 500; }
.sc-head .sc-sub { width: 100%; font-size: 13px; color: var(--muted); margin-top: -6px; }
.sc-head .sc-actions { margin-left: auto; display: flex; gap: 8px; }

.sc-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    border-radius: var(--pill);
    font-size: 11px; font-weight: 700; letter-spacing: .3px;
    background: var(--surface-2); color: var(--muted);
    border: 1px solid var(--line);
}
.sc-pill.waiting { color: var(--warn); border-color: rgba(245, 158, 11, .35); }
.sc-pill.claimed { color: var(--ok); border-color: rgba(34, 197, 94, .35); }
.sc-pill.locked  { color: var(--danger); border-color: rgba(239, 68, 68, .35); }
.sc-pill img { width: 16px; height: 16px; border-radius: 50%; }

.sc-mini {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px;
    border-radius: var(--pill);
    border: 1px solid var(--line-strong);
    background: transparent; color: var(--text);
    font: inherit; font-size: 12px; font-weight: 650;
    cursor: pointer; text-decoration: none;
    transition: all .15s ease;
}
.sc-mini:hover { border-color: #fff; }
.sc-mini.danger { color: var(--danger); border-color: rgba(239, 68, 68, .4); }
.sc-mini.danger:hover { background: rgba(239, 68, 68, .1); border-color: var(--danger); }
.sc-mini i { font-size: 11px; }

.sc-msgs {
    flex: 1;
    overflow-y: auto;
    padding: 20px 20px 10px;
    display: flex; flex-direction: column; gap: 4px;
    scroll-behavior: smooth;
    min-height: 320px; max-height: 60vh;
}
.sc-day {
    display: flex; align-items: center; gap: 12px;
    margin: 14px 0 10px;
    font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--dim);
}
.sc-day::before, .sc-day::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.sc-msg {
    display: grid; grid-template-columns: 36px 1fr; gap: 12px;
    padding: 6px 8px; border-radius: 12px;
    max-width: 82%;
}
.sc-msg img.sc-av { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.sc-msg .sc-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.sc-msg .sc-name { font-size: 13px; font-weight: 700; }
.sc-msg .sc-name.staff { color: var(--accent-2); }
.sc-msg .sc-name.bot { color: #a78bfa; }
.sc-msg .sc-time { font-size: 11px; color: var(--dim); }
.sc-tag {
    font-size: 9.5px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase;
    padding: 2px 6px; border-radius: 4px;
    background: rgba(61, 123, 255, .18); color: var(--accent-2);
}
.sc-tag.bot { background: rgba(139, 92, 246, .18); color: #c4b5fd; }
.sc-tag.site { background: rgba(255, 255, 255, .08); color: var(--muted); }
.sc-bubble {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 4px 14px 14px 14px;
    background: var(--surface-2);
    font-size: 14px; line-height: 1.55;
    word-wrap: break-word; overflow-wrap: anywhere;
    max-width: 100%;
}
.sc-msg.cont { margin-top: -4px; }
.sc-msg.cont .sc-meta { display: none; }
/* Keep the avatar cell so the text stays in the wide column; just make it invisible. */
.sc-msg.cont img.sc-av { visibility: hidden; height: 0; }
.sc-msg.cont .sc-bubble { border-radius: 14px; }

.sc-msg.me { margin-left: auto; grid-template-columns: 1fr; }
.sc-msg.me img.sc-av { display: none; }
.sc-msg.me .sc-meta { justify-content: flex-end; }
.sc-msg.me .sc-bubble { background: var(--accent); color: #fff; border-radius: 14px 4px 14px 14px; }
.sc-msg.me .sc-bubble a { color: #fff; text-decoration: underline; }
.sc-msg.me .sc-bubble code { background: rgba(0, 0, 0, .25); }
.sc-msg.me.cont .sc-bubble { border-radius: 14px; }
.sc-msg.me .sc-time { order: -1; }

.sc-card {
    border-left: 3px solid var(--accent);
    background: var(--surface-2);
    border-radius: 6px 12px 12px 6px;
    padding: 10px 14px;
    font-size: 13px; line-height: 1.55; color: var(--muted);
    white-space: pre-wrap;
    max-width: 100%;
}
.sc-card b { color: var(--text); }

.sc-bubble code, .sc-card code {
    font-family: var(--mono); font-size: 12.5px;
    background: rgba(255, 255, 255, .08);
    padding: 1px 6px; border-radius: 5px;
}
.sc-bubble pre {
    font-family: var(--mono); font-size: 12.5px; line-height: 1.5;
    background: var(--bg); border: 1px solid var(--line);
    border-radius: 8px; padding: 10px 12px; margin: 6px 0;
    overflow-x: auto; white-space: pre;
}
.sc-bubble a { color: var(--accent-2); }
.sc-att { display: block; margin-top: 8px; }
.sc-att img { max-width: 360px; max-height: 260px; border-radius: 10px; display: block; }
.sc-att.file {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-radius: 10px;
    background: var(--surface-3); color: var(--text); font-size: 13px;
}
.sc-att.file small { color: var(--dim); }

.sc-notice {
    text-align: center; font-size: 12.5px; color: var(--dim);
    padding: 14px 0 4px;
}
.sc-notice i { color: var(--accent); margin-right: 6px; }

/* ---- composer ---- */
.sc-compose {
    display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end;
    padding: 14px 20px 16px;
    border-top: 1px solid var(--line);
    background: var(--bg-2);
}
.sc-compose textarea {
    width: 100%; min-height: 48px; max-height: 180px; resize: none;
    padding: 13px 16px;
    border: 1px solid var(--line-strong); border-radius: 14px;
    background: var(--surface); color: var(--text);
    font: inherit; font-size: 14px; line-height: 1.45;
}
.sc-compose textarea:focus { outline: none; border-color: var(--accent); }
.sc-compose textarea:disabled { opacity: .5; }
.sc-send {
    width: 48px; height: 48px; border-radius: 50%;
    border: 0; background: var(--accent); color: #fff;
    font-size: 16px; cursor: pointer;
    display: grid; place-items: center;
    transition: all .15s ease;
}
.sc-send:hover { background: #2f6df0; transform: translateY(-1px); }
.sc-send:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.sc-compose-note { grid-column: 1 / -1; font-size: 11.5px; color: var(--dim); margin-top: -4px; }
.sc-compose-note b { color: var(--danger); font-weight: 650; }

/* ---- new ticket form ---- */
.sc-form { padding: 26px 28px 30px; max-width: 680px; }
.sc-form h3 { font-size: 20px; font-weight: 800; letter-spacing: -.4px; margin-bottom: 6px; }
.sc-form > p { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.sc-form .fld { margin-bottom: 14px; }
.sc-form .fld textarea { min-height: 150px; resize: vertical; line-height: 1.5; }
.sc-topics { display: flex; flex-wrap: wrap; gap: 8px; }
.sc-topic {
    padding: 9px 14px; border-radius: var(--pill);
    border: 1px solid var(--line-strong); background: transparent; color: var(--muted);
    font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer;
    transition: all .12s ease;
}
.sc-topic:hover { color: var(--text); border-color: #fff; }
.sc-topic.on { background: var(--accent-soft); border-color: var(--accent); color: #fff; }
.sc-form-actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.sc-form-actions .sc-err { color: var(--danger); font-size: 13px; }
.sc-tips {
    margin-top: 22px; padding: 14px 16px;
    border: 1px dashed var(--line-strong); border-radius: 12px;
    font-size: 12.5px; color: var(--muted); line-height: 1.6;
}
.sc-tips b { color: var(--text); }

.sc-loading { padding: 40px; text-align: center; color: var(--dim); font-size: 13px; }
.sc-loading i { margin-right: 8px; color: var(--accent); }

@media (max-width: 900px) {
    .sc { grid-template-columns: 1fr; }
    .sc-side { border-right: 0; border-bottom: 1px solid var(--line); }
    .sc-side.hide-mobile { display: none; }
    .sc-msg { max-width: 94%; }
    .sc-gate { grid-template-columns: auto 1fr; }
    .sc-gate .sc-gate-actions { grid-column: 1 / -1; justify-content: flex-start; }
    .sc-back { display: inline-flex !important; }
}
.sc-back { display: none; }
