:root {
    --bg: #090a13;
    --ink: #eceefb;
    --muted: #9aa0bd;
    --line: rgba(255, 255, 255, .10);
    --glass: rgba(255, 255, 255, .06);
    --glass-hi: rgba(255, 255, 255, .10);
    --violet: #9d6bff;
    --violet-deep: #7c4dff;
    --mint: #3ee6b0;
    --rose: #ff6b7f;
    --font: "Sora", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif
}

* {
    box-sizing: border-box
}

html {
    background: var(--bg)
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font: 400 15px/1.5 var(--font);
    background: radial-gradient(900px 600px at 8% -10%, rgba(124, 77, 255, .38), transparent 60%), radial-gradient(800px 600px at 105% 10%, rgba(40, 170, 220, .22), transparent 60%), radial-gradient(700px 500px at 60% 115%, rgba(255, 107, 127, .16), transparent 60%), var(--bg);
    background-attachment: fixed
}

[hidden] {
    display: none !important
}

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

:focus-visible {
    outline: 2px solid var(--violet);
    outline-offset: 2px
}

.glass {
    background: var(--glass);
    border: 1px solid var(--line);
    border-radius: 20px;
    backdrop-filter: blur(18px) saturate(140%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 24px 50px -24px rgba(0, 0, 0, .7)
}

.shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 20px;
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px 16px 120px
}

.side {
    position: sticky;
    top: 24px;
    align-self: start;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow-y: auto
}

.brand {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -.01em;

    display: flex;
    align-items: center;
    gap: 10px;
}

.brand img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex: 0 0 24px;
}

.brand {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.brand:hover {
    opacity: .9;
}

.side h2 {
    font-size: .85rem;
    font-weight: 600;
    color: var(--muted);
    margin: 0 0 6px
}

#servers {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: auto
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 4px
}

.nav-link {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 9px 10px;
    border-radius: 12px;
    border: 1px solid transparent;
    color: var(--ink);
    text-decoration: none;
    background: transparent;
    transition: background .18s, border-color .18s, transform .18s
}

.nav-link:hover {
    background: var(--glass);
    border-color: var(--line);
    transform: translateX(2px)
}

.nav-link::before {
    content: "";
    width: 7px;
    height: 7px;
    margin-right: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--violet), var(--mint));
    flex: none
}

.nav-link.active {
    background: rgba(157, 107, 255, .16);
    border-color: rgba(157, 107, 255, .18)
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
}

.nav-icon svg {
    display: block;
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.nav-link span:not(.nav-icon) {
    min-width: 0;
}

.srv {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    text-align: left
}

.srv:hover {
    background: var(--glass)
}

.srv[aria-current=true] {
    background: var(--glass-hi);
    border-color: var(--line)
}

.srv .ic {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    flex: none;
    object-fit: cover;
    background: linear-gradient(135deg, #3a3f66, #222542);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: .8rem
}

.srv span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

main {
    min-width: 0
}

.top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin: 6px 4px 18px
}

h1 {
    margin: 0;
    font-size: 1.7rem;
    letter-spacing: -.02em;
    line-height: 1.15
}

.sub {
    color: var(--muted);
    margin: 4px 0 0
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: .82rem;
    background: var(--glass);
    border: 1px solid var(--line)
}

.pill i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted)
}

.pill.ok i {
    background: var(--mint);
    box-shadow: 0 0 10px var(--mint)
}

.pill.warn i {
    background: #ffc15e
}

.grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 20px;
    align-items: start
}

.col {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0
}

.card {
    padding: 20px;
    min-width: 0
}

.card h3 {
    margin: 0 0 2px;
    font-size: 1.05rem
}

.hint {
    color: var(--muted);
    font-size: .85rem;
    margin: 0 0 14px
}

label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    margin: 14px 0 6px
}

.field {
    width: 100%;
    padding: 11px 13px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(8, 9, 20, .55)
}

.field:hover {
    border-color: rgba(255, 255, 255, .2)
}

select.field option {
    background: #14162a;
    color: var(--ink)
}

.row {
    display: flex;
    gap: 8px
}

.row .field {
    flex: 1;
    min-width: 0
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px
}

.chip {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--glass);
    font-size: .8rem;
    cursor: pointer
}

.chip:hover {
    background: var(--glass-hi)
}

.count {
    font-size: .78rem;
    color: var(--muted);
    float: right;
    font-weight: 400
}

.warn-txt {
    color: #ffc15e;
    font-size: .82rem;
    margin: 6px 0 0
}

.check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
    font-size: .85rem;
    font-weight: 500
}

.check input {
    accent-color: var(--violet)
}

.btn {
    padding: 11px 18px;
    border-radius: 12px;
    border: 0;
    font-weight: 600;
    cursor: pointer;
    background: var(--rk-primary);
    color: #fff
}

.btn:hover {
    filter: brightness(1.1)
}

.btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    filter: none
}

.btn.ghost {
    background: var(--glass);
    box-shadow: none;
    border: 1px solid var(--line)
}

.btn.sm {
    padding: 7px 12px;
    font-size: .82rem;
    background: transparent;
    color: var(--rose);
    border: 1px solid var(--line);
    box-shadow: none
}

.btn.sm:hover {
    background: rgba(255, 107, 127, .1)
}

.meter {
    display: block;
    width: 100%;
    height: 8px;
    margin: 10px 0;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
}

.meter #meter {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--violet), var(--mint));
    transition: width 0.3s ease;
}

.item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--line)
}

.item .nm {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.item small {
    display: block;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis
}

.empty {
    padding: 18px 4px 4px;
    color: var(--muted);
    border-top: 1px solid var(--line)
}

.preview {
    position: sticky;
    top: 24px;
    padding: 20px
}

.dc {
    background: #1b1d2e;
    border-radius: 14px;
    padding: 14px;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: .9rem
}

.dc .msg {
    margin: 0 0 10px;
    word-break: break-word
}

.mention {
    background: rgba(157, 107, 255, .25);
    color: #cdb8ff;
    border-radius: 4px;
    padding: 0 4px
}

.emb {
    border-left: 4px solid #ff4545;
    background: #14162a;
    border-radius: 6px;
    padding: 10px 12px
}

.emb .au {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: .82rem
}

.emb .au i {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff4545;
    flex: none
}

.emb .tt {
    color: #6fb8ff;
    font-weight: 600;
    margin: 6px 0;
    overflow-wrap: anywhere
}

.emb .meta {
    font-size: .82rem;
    color: var(--muted);
    margin: 4px 0 8px
}

.emb .th {
    aspect-ratio: 16/9;
    border-radius: 6px;
    background: linear-gradient(135deg, #5c2630, #16384f);
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, .65);
    font-size: .78rem;
    text-align: center;
    padding: 10px
}

.dc .go {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 14px;
    border-radius: 6px;
    background: #2b2e45;
    color: #e5e7f7;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none
}

.bar {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px 12px 20px;
    border-radius: 999px;
    width: max-content;
    max-width: calc(100vw - 24px)
}

.bar span {
    font-size: .9rem
}

#toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 18px;
    border-radius: 999px;
    display: none;
    z-index: 30;
    font-size: .9rem
}

#toast.ok {
    border-color: var(--mint)
}

#toast.err {
    border-color: var(--rose)
}

.center {
    max-width: 440px;
    margin: 12vh auto;
    padding: 36px 28px;
    text-align: center
}

.center p {
    color: var(--muted)
}

a.btn {
    display: inline-block;
    text-decoration: none
}

.premium-link {
    display: flex;
    align-items: center;
    gap: 8px
}

.premium-link span {
    font-size: 16px;
    line-height: 1
}

.support-nav {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, .08)
}

.premium-link.premium-active {
    border-color: rgba(62, 230, 176, .32);
    color: var(--mint);
    background: rgba(62, 230, 176, .08)
}

.premium-link {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    border-color: rgba(157, 107, 255, .28);
    background: rgba(157, 107, 255, .08);
    transition: background .2s ease, border-color .2s ease;
}

.premium-link:hover {
    background: rgba(157, 107, 255, .17);
    border-color: rgba(157, 107, 255, .55);
}

.premium-link span {
    font-size: 16px;
    line-height: 1;
}

.premium-link.premium-active {
    border-color: rgba(62, 230, 176, .32);
    color: #3ee6b0;
    background: rgba(62, 230, 176, .08);
}

.premium-link.premium-active:hover {
    background: rgba(62, 230, 176, .14);
    border-color: rgba(62, 230, 176, .5);
}

.premium-link::before,
.support-link::before {
    display: none;
    content: none;
}

@media(max-width:980px) {
    .grid {
        grid-template-columns: 1fr
    }

    .preview {
        position: static
    }
}

@media(max-width:860px) {
    .shell {
        grid-template-columns: 1fr;
        padding: 12px 12px 100px
    }

    .side {
        position: static;
        max-height: none;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center
    }

    .brand {
        width: 100%
    }

    #servers-wrap {
        order: 3;
        width: 100%
    }

    #servers {
        flex-direction: row;
        overflow-x: auto
    }

    .srv {
        width: auto;
        flex: none
    }

    .nav-section {
        min-width: 0
    }

    .me {
        margin: 0 0 0 auto;
        border: 0;
        padding: 0
    }

    .top {
        align-items: flex-start
    }

    .bar {
        border-radius: 18px;
        flex-wrap: wrap;
        justify-content: center
    }
}

@media(max-width:520px) {
    .row {
        align-items: stretch
    }

    .row .btn {
        padding: 10px 12px
    }

    .card,
    .preview {
        padding: 16px
    }

    .top {
        margin-left: 2px
    }

    .top h1 {
        font-size: 1.45rem
    }
}

@media(prefers-reduced-motion:reduce) {
    * {
        transition: none !important
    }
}
