:root {
    color-scheme: dark;

    --bg: #09060f;
    --panel: rgba(20, 13, 31, 0.92);
    --panel-soft: rgba(31, 19, 48, 0.78);
    --border: rgba(181, 97, 255, 0.24);
    --border-strong: rgba(181, 97, 255, 0.52);

    --text: #f8f4ff;
    --muted: #afa5bd;

    --purple: #a544ff;
    --purple-light: #cb7cff;

    --danger: #ff5d75;
    --success: #55e6a5;
    --warning: #ffcf5c;

    --shadow:
        0 22px 70px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;

    color: var(--text);

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background:
        radial-gradient(
            circle at 20% 0%,
            rgba(132, 40, 255, 0.18),
            transparent 34rem
        ),
        radial-gradient(
            circle at 100% 25%,
            rgba(203, 78, 255, 0.12),
            transparent 28rem
        ),
        #09060f;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.b3-support-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;

    background-image:
        linear-gradient(
            rgba(255,255,255,.018) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255,255,255,.018) 1px,
            transparent 1px
        );

    background-size: 34px 34px;

    mask-image:
        linear-gradient(
            to bottom,
            black,
            transparent 80%
        );
}

.b3-support-header {
    position: sticky;
    top: 0;
    z-index: 20;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    min-height: 74px;

    padding: 14px clamp(18px, 4vw, 54px);

    border-bottom:
        1px solid rgba(255,255,255,.07);

    background:
        rgba(9, 6, 15, .78);

    backdrop-filter: blur(18px);
}

.b3-support-brand {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;

    color: white;
    text-decoration: none;

    font-weight: 1000;
    letter-spacing: -.04em;
}

.b3-brand-main {
    font-size: 22px;
}

.b3-brand-sub {
    color: var(--purple-light);
    font-size: 13px;
    letter-spacing: .12em;
}

.b3-header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.b3-account-state {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.b3-home-button,
.b3-primary-button,
.b3-small-button {
    border: 0;
    cursor: pointer;
    text-decoration: none;

    transition:
        transform .15s ease,
        border-color .15s ease,
        background .15s ease;
}

.b3-home-button {
    padding: 10px 14px;

    border:
        1px solid var(--border);

    border-radius: 10px;

    color: white;

    background:
        rgba(255,255,255,.04);

    font-size: 12px;
    font-weight: 900;
}

.b3-home-button:hover,
.b3-small-button:hover {
    border-color:
        var(--border-strong);

    transform:
        translateY(-1px);
}

.b3-support-main {
    position: relative;
    z-index: 2;

    width:
        min(1200px, calc(100% - 32px));

    margin: 0 auto;

    padding:
        70px 0 90px;
}

.b3-support-hero {
    max-width: 760px;
    margin-bottom: 42px;
}

.b3-eyebrow,
.b3-section-label {
    color: var(--purple-light);

    font-size: 11px;
    line-height: 1;

    font-weight: 950;

    letter-spacing: .18em;
}

.b3-support-hero h1 {
    margin:
        12px 0 12px;

    font-size:
        clamp(44px, 8vw, 86px);

    line-height: .95;

    letter-spacing: -.055em;
}

.b3-support-hero p {
    max-width: 650px;

    margin: 0;

    color: var(--muted);

    font-size:
        clamp(16px, 2vw, 19px);

    line-height: 1.65;
}

.b3-support-grid {
    display: grid;

    grid-template-columns:
        minmax(0, .95fr)
        minmax(0, 1.05fr);

    gap: 22px;

    align-items: start;
}

.b3-panel {
    border:
        1px solid var(--border);

    border-radius: 20px;

    padding:
        clamp(19px, 3vw, 28px);

    background:
        linear-gradient(
            145deg,
            rgba(29, 18, 44, .94),
            rgba(16, 10, 25, .94)
        );

    box-shadow:
        var(--shadow);
}

.b3-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    margin-bottom: 24px;
}

.b3-panel-heading h2,
.b3-login-required h2,
.b3-ticket-modal h2 {
    margin: 7px 0 0;

    font-size:
        clamp(22px, 3vw, 29px);

    letter-spacing: -.035em;
}

.b3-field {
    display: block;
    margin-bottom: 18px;
}

.b3-field > span {
    display: block;

    margin-bottom: 8px;

    color: #d9d0e5;

    font-size: 12px;
    font-weight: 850;

    letter-spacing: .04em;
}

.b3-field input,
.b3-field select,
.b3-field textarea {
    width: 100%;

    border:
        1px solid rgba(255,255,255,.11);

    outline: none;

    border-radius: 12px;

    padding:
        13px 14px;

    color: white;

    background:
        rgba(3, 2, 7, .48);

    transition:
        border-color .15s ease,
        box-shadow .15s ease;
}

.b3-field textarea {
    resize: vertical;

    min-height: 118px;

    line-height: 1.5;
}

.b3-field input:focus,
.b3-field select:focus,
.b3-field textarea:focus {
    border-color:
        rgba(174, 83, 255, .78);

    box-shadow:
        0 0 0 3px
        rgba(165, 68, 255, .12);
}

.b3-primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;

    padding:
        12px 18px;

    border-radius: 11px;

    color: white;

    background:
        linear-gradient(
            135deg,
            #8c32ef,
            #bd50ff
        );

    box-shadow:
        0 10px 28px
        rgba(154, 54, 255, .21);

    font-size: 12px;
    font-weight: 1000;

    letter-spacing: .04em;
}

.b3-primary-button:hover {
    transform:
        translateY(-1px);
}

.b3-primary-button:disabled {
    opacity: .5;
    cursor: wait;
    transform: none;
}

.b3-full-button {
    width: 100%;
}

.b3-small-button {
    padding:
        8px 11px;

    border:
        1px solid var(--border);

    border-radius: 9px;

    color: white;

    background:
        rgba(255,255,255,.035);

    font-size: 10px;
    font-weight: 900;

    letter-spacing: .08em;
}

.b3-empty-state {
    padding:
        32px 18px;

    border:
        1px dashed rgba(255,255,255,.11);

    border-radius: 14px;

    color: var(--muted);

    text-align: center;

    font-size: 13px;
}

.b3-ticket-list {
    display: grid;
    gap: 10px;
}

.b3-ticket-card {
    width: 100%;

    border:
        1px solid rgba(255,255,255,.08);

    border-radius: 14px;

    padding: 15px;

    color: inherit;
    text-align: left;

    background:
        rgba(255,255,255,.025);

    cursor: pointer;

    transition:
        transform .15s ease,
        border-color .15s ease,
        background .15s ease;
}

.b3-ticket-card:hover {
    transform:
        translateY(-1px);

    border-color:
        var(--border-strong);

    background:
        rgba(165, 68, 255, .07);
}

.b3-ticket-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;

    margin-bottom: 9px;
}

.b3-ticket-id {
    color: var(--purple-light);

    font-size: 11px;
    font-weight: 950;
}

.b3-ticket-subject {
    margin-bottom: 10px;

    font-size: 15px;
    font-weight: 850;

    line-height: 1.35;
}

.b3-ticket-bottom {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.b3-chip {
    display: inline-flex;

    border:
        1px solid rgba(255,255,255,.10);

    border-radius: 999px;

    padding:
        5px 8px;

    color: #c7becf;

    background:
        rgba(255,255,255,.035);

    font-size: 9px;
    font-weight: 900;

    letter-spacing: .05em;
    text-transform: uppercase;
}

.b3-status-open,
.b3-status-in_progress {
    border-color:
        rgba(85,230,165,.28);

    color:
        #7cf1bb;
}

.b3-status-waiting_for_user {
    border-color:
        rgba(255,207,92,.3);

    color:
        #ffda77;
}

.b3-status-resolved {
    color:
        #87d6ff;
}

.b3-status-closed {
    color:
        #99909f;
}

.b3-form-message,
.b3-global-message {
    border-radius: 11px;

    padding:
        11px 13px;

    margin-bottom: 15px;

    color: #eee7f5;

    background:
        rgba(255,255,255,.05);

    font-size: 12px;
    line-height: 1.45;
}

.b3-message-error {
    border:
        1px solid rgba(255,93,117,.25);

    background:
        rgba(255,93,117,.08);
}

.b3-message-success {
    border:
        1px solid rgba(85,230,165,.25);

    background:
        rgba(85,230,165,.07);
}

.b3-login-required {
    display: flex;
    align-items: center;
    gap: 20px;

    max-width: 700px;
}

.b3-login-required p {
    color: var(--muted);
    line-height: 1.55;
}

.b3-panel-icon {
    flex:
        0 0 56px;

    display: grid;
    place-items: center;

    width: 56px;
    height: 56px;

    border:
        1px solid var(--border-strong);

    border-radius: 16px;

    color: var(--purple-light);

    background:
        rgba(165,68,255,.09);

    font-size: 28px;
    font-weight: 1000;
}

.b3-modal[hidden] {
    display: none;
}

.b3-modal {
    position: fixed;
    inset: 0;
    z-index: 100;

    display: grid;
    place-items: center;

    padding: 18px;
}

.b3-modal-backdrop {
    position: absolute;
    inset: 0;

    background:
        rgba(2, 1, 5, .78);

    backdrop-filter:
        blur(10px);
}

.b3-ticket-modal {
    position: relative;
    z-index: 1;

    display: flex;
    flex-direction: column;

    width:
        min(760px, 100%);

    max-height:
        min(850px, 92vh);

    border:
        1px solid var(--border-strong);

    border-radius: 21px;

    padding:
        clamp(18px, 3vw, 28px);

    background:
        #120b1d;

    box-shadow:
        0 30px 100px
        rgba(0,0,0,.62);
}

.b3-ticket-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.b3-close-button {
    width: 38px;
    height: 38px;

    border:
        1px solid rgba(255,255,255,.1);

    border-radius: 10px;

    color: white;

    background:
        rgba(255,255,255,.04);

    cursor: pointer;

    font-size: 24px;
    line-height: 1;
}

.b3-ticket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;

    margin:
        17px 0;
}

.b3-conversation {
    flex: 1;
    overflow-y: auto;

    min-height: 200px;

    border-top:
        1px solid rgba(255,255,255,.07);

    border-bottom:
        1px solid rgba(255,255,255,.07);

    padding:
        18px 2px;

    margin-bottom: 18px;
}

.b3-message {
    max-width: 80%;

    margin-bottom: 12px;

    border-radius:
        14px 14px 14px 4px;

    padding:
        11px 13px;

    background:
        rgba(255,255,255,.055);
}

.b3-message-user {
    margin-left: auto;

    border-radius:
        14px 14px 4px 14px;

    background:
        rgba(151, 55, 238, .20);
}

.b3-message-staff {
    background:
        rgba(62, 134, 255, .13);
}

.b3-message-system,
.b3-message-ai {
    max-width: 100%;

    color: var(--muted);

    background:
        rgba(255,255,255,.025);
}

.b3-message-label {
    margin-bottom: 5px;

    color: var(--purple-light);

    font-size: 9px;
    font-weight: 950;

    letter-spacing: .08em;
    text-transform: uppercase;
}

.b3-message-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;

    font-size: 13px;
    line-height: 1.55;
}

.b3-message-time {
    margin-top: 7px;

    color: #81788a;

    font-size: 9px;
}

.b3-reply-form {
    flex: 0 0 auto;
}

.b3-reply-form .b3-field {
    margin-bottom: 10px;
}

@media (max-width: 850px) {

    .b3-support-grid {
        grid-template-columns: 1fr;
    }

    .b3-support-header {
        align-items: flex-start;
    }

    .b3-header-right {
        flex-direction: column;
        align-items: flex-end;
        gap: 7px;
    }

    .b3-account-state {
        font-size: 10px;
    }
}

@media (max-width: 560px) {

    .b3-support-main {
        width:
            min(100% - 20px, 1200px);

        padding-top: 44px;
    }

    .b3-support-header {
        padding:
            12px 13px;
    }

    .b3-brand-main {
        font-size: 17px;
    }

    .b3-account-state {
        display: none;
    }

    .b3-home-button {
        padding:
            8px 10px;

        font-size: 9px;
    }

    .b3-support-hero h1 {
        font-size: 48px;
    }

    .b3-panel {
        border-radius: 16px;
        padding: 16px;
    }

    .b3-ticket-modal {
        padding: 16px;
        max-height: 95vh;
    }

    .b3-message {
        max-width: 90%;
    }
}