:root {
    --bg: #06111d;
    --bg-deep: #030a12;
    --bg-panel: #0b1a2a;
    --bg-panel-2: #0d2032;
    --bg-panel-3: #10263a;
    --bg-soft: #0a1725;
    --line: #1b3a51;
    --line-soft: #122c40;
    --text: #f4f8fc;
    --text-soft: #a7bbcd;
    --text-muted: #718ca2;
    --blue: #1476ff;
    --blue-2: #1db7ff;
    --cyan: #17d7ff;
    --green: #22d99a;
    --yellow: #f4c85a;
    --orange: #ff7b56;
    --purple: #9b6cff;
    --red: #ff5d6c;
    --discord: #5865f2;
    --shadow: 0 18px 46px rgba(0, 0, 0, .28);
    --radius: 14px;
    --radius-sm: 10px;
    --sidebar: 260px;
    --topbar: 74px;
}

* { box-sizing: border-box; }
html { background: var(--bg-deep); }
body {
    margin: 0;
    color: var(--text);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background:
        radial-gradient(circle at 72% 10%, rgba(20,118,255,.08), transparent 26rem),
        linear-gradient(180deg, #07131f 0%, #06111d 100%);
    min-height: 100vh;
    font-size: 14px;
}
button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
svg { display: block; }
.svg-sprite { position: absolute; overflow: hidden; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.icon-sm { width: 15px; height: 15px; }
.icon-xs { width: 12px; height: 12px; }
.accent { color: var(--blue-2); }
.muted { color: var(--text-muted); }

/* ---------- Header ---------- */
.topbar {
    height: var(--topbar);
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 4px solid rgba(255,255,255,.08);
    border-bottom: 1px solid var(--line-soft);
    background: rgba(5, 16, 27, .94);
    backdrop-filter: blur(18px);
    box-shadow: 0 8px 28px rgba(0,0,0,.18);
}
.brand-zone { height: 100%; display: flex; align-items: center; }
.brand {
    width: var(--sidebar);
    height: 100%;
    padding: 0 22px;
    display: flex;
    align-items: center;
    gap: 11px;
    border-right: 1px solid var(--line-soft);
}
.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(29,183,255,.45);
    border-radius: 13px;
    color: var(--cyan);
    background: linear-gradient(135deg, rgba(20,118,255,.16), rgba(29,183,255,.04));
    box-shadow: inset 0 0 18px rgba(29,183,255,.07), 0 0 18px rgba(20,118,255,.08);
}
.brand-mark img { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; }
.brand-name { font-size: 21px; font-style: italic; letter-spacing: .2px; color: #dceaf6; font-weight: 700; }
.brand-name strong { color: #fff; }
.switcher { margin-left: 18px; }
.switcher-button,
.profile-button {
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(16,38,58,.96), rgba(8,22,35,.96));
    border-radius: 11px;
    height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: border-color .18s, background .18s, box-shadow .18s;
}
.switcher-button { min-width: 190px; padding: 0 13px; font-weight: 700; }
.switcher-button:hover, .profile-button:hover, [data-dropdown].open > .dropdown-trigger { border-color: #2b607f; background: #0d2133; box-shadow: 0 0 0 3px rgba(20,118,255,.06); }
.switcher-mini { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; color: var(--cyan); background: rgba(20,118,255,.13); }
.switcher-mini img { width: 21px; height: 21px; border-radius: 6px; object-fit: cover; }
.dropdown-arrow { margin-left: auto; color: #7ba5c2; transition: transform .18s; }
[data-dropdown].open > .dropdown-trigger .dropdown-arrow { transform: rotate(180deg); }
.profile { margin-right: 20px; }
.profile-button { border-color: transparent; background: transparent; min-width: 160px; padding: 0 10px; font-weight: 700; }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 1px solid #2e5570; background: #0c2030; }
.avatar-lg { width: 44px; height: 44px; }
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    min-width: 220px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(6,18,30,.985);
    box-shadow: 0 22px 50px rgba(0,0,0,.38);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: opacity .16s, transform .16s, visibility .16s;
    z-index: 80;
}
[data-dropdown].open > .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.switcher-menu { left: 0; min-width: 240px; }
.profile-menu { right: 0; min-width: 260px; }
.dropdown-menu > a,
.dropdown-disabled,
.logout-link {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 11px;
    border-radius: 8px;
    color: #c9d9e7;
}
.dropdown-menu > a:hover { background: #0d2235; color: #fff; }
.dropdown-menu > a.selected { color: #fff; background: rgba(20,118,255,.1); }
.dropdown-disabled { color: #758da0; cursor: default; }
.dropdown-disabled small { font-size: 10px; color: #526c7f; }
.check { color: var(--blue-2); font-weight: 800; }
.dropdown-separator { height: 1px; margin: 6px 4px; background: var(--line-soft); }
.profile-summary { display: flex; align-items: center; gap: 11px; padding: 9px 10px 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.profile-summary div { min-width: 0; }
.profile-summary strong, .profile-summary small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-summary small { margin-top: 3px; color: var(--text-muted); font-size: 11px; }
.profile-menu form { margin: 0; }
.logout-link { width: 100%; border: 0; background: transparent; color: var(--red); justify-content: flex-start; cursor: pointer; }
.logout-link:hover { background: rgba(255,93,108,.08); }

/* ---------- App shell / Sidebar ---------- */
.app-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; padding-top: var(--topbar); }
.sidebar {
    position: fixed;
    top: var(--topbar);
    left: 0;
    bottom: 0;
    width: var(--sidebar);
    padding: 14px 12px 30px;
    background: linear-gradient(180deg, rgba(5,16,27,.98), rgba(3,12,20,.98));
    border-right: 1px solid var(--line-soft);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #15344a transparent;
    z-index: 30;
}
.server-zone { width: 100%; }
.server-card {
    width: 100%;
    min-height: 61px;
    display: grid;
    grid-template-columns: 42px minmax(0,1fr) 16px;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid #1b4058;
    border-radius: 11px;
    color: var(--text);
    background: linear-gradient(135deg, #0c2031, #091724);
    cursor: pointer;
    text-align: left;
    box-shadow: inset 0 0 18px rgba(20,118,255,.035);
}
.server-card:hover, .server-zone.open .server-card { border-color: #2e7398; }
.server-icon { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 1px solid #2a5977; background: #0d2437; }
.server-fallback { display: grid; place-items: center; font-weight: 800; color: #dff4ff; background: linear-gradient(135deg, #124581, #0c2743); }
.server-info { min-width: 0; }
.server-info strong, .server-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-info strong { font-size: 12.5px; }
.server-info small { margin-top: 4px; font-size: 10px; color: #8ca6b9; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(34,217,154,.65); }
.server-menu { left: 0; right: auto; width: 292px; max-height: 430px; overflow-y: auto; }
.server-menu-title { padding: 8px 10px 7px; color: #4ea8d5; font-size: 9px; font-weight: 800; letter-spacing: 1.6px; }
.server-select-form { margin: 0; }
.server-option { width: 100%; border: 0; background: transparent; display: grid; grid-template-columns: 34px minmax(0,1fr) 18px; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 8px; color: #bcd0df; text-align: left; cursor: pointer; }
.server-option:hover, .server-option.selected { background: #0e2639; color: #fff; }
.server-option img, .server-option-fallback { width: 34px; height: 34px; border-radius: 50%; }
.server-option-fallback { display: grid; place-items: center; background: #123454; color: #d8f1ff; font-weight: 800; font-size: 11px; }
.server-option strong, .server-option small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.server-option strong { font-size: 11.5px; }
.server-option small { margin-top: 2px; color: #738fa5; font-size: 9.5px; }
.server-menu-empty { padding: 14px 10px; color: var(--text-muted); font-size: 11px; }
.add-server-menu { justify-content: flex-start !important; color: var(--blue-2) !important; font-weight: 700; }
.refresh-servers-form { margin: 2px 0; }
.refresh-servers-button { width: 100%; min-height: 38px; display: flex; align-items: center; gap: 9px; padding: 8px 11px; border: 0; border-radius: 8px; color: #88a9bf; background: transparent; cursor: pointer; text-align: left; font-size: 11px; font-weight: 650; }
.refresh-servers-button:hover { color: #fff; background: #0d2235; }
.refresh-symbol { color: var(--blue-2); font-size: 17px; line-height: 1; }
.add-server-button {
    height: 36px;
    margin: 8px 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px dashed #197fc0;
    border-radius: 8px;
    color: #43bfff;
    background: rgba(20,118,255,.035);
    font-size: 11px;
    font-weight: 700;
    transition: .18s;
}
.add-server-button:hover { background: rgba(20,118,255,.1); border-color: var(--blue-2); }
.add-server-button .icon { width: 15px; height: 15px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-section { margin-top: 3px; }
.nav-section-toggle { width: 100%; height: 27px; display: flex; align-items: center; justify-content: space-between; padding: 0 9px; border: 0; background: transparent; color: #3f8fb8; cursor: pointer; font-size: 9px; font-weight: 800; letter-spacing: 1.45px; }
.nav-section-toggle .icon { color: #4685a5; transition: transform .18s; }
.nav-section.collapsed .nav-section-toggle .icon { transform: rotate(-90deg); }
.nav-section-items { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .2s ease, opacity .2s ease; opacity: 1; }
.nav-section-items > * { min-height: 0; }
.nav-section.collapsed .nav-section-items { display: none; }
.nav-link { position: relative; height: 31px; display: flex; align-items: center; gap: 10px; padding: 0 11px; border: 1px solid transparent; border-radius: 7px; color: #9bb6c8; font-size: 11.5px; font-weight: 600; transition: color .15s, background .15s, border-color .15s; }
.nav-link .icon { width: 15px; height: 15px; color: #3aa9d9; stroke-width: 2; }
.nav-link:hover { color: #eaf7ff; background: rgba(15,43,64,.55); }
.nav-link.active { color: #fff; border-color: #1d78a6; background: linear-gradient(90deg, rgba(15,101,145,.35), rgba(14,39,57,.72)); box-shadow: inset 0 0 18px rgba(22,163,221,.06); }
.nav-active-line { position: absolute; left: -1px; top: 5px; bottom: 5px; width: 3px; border-radius: 0 3px 3px 0; background: var(--cyan); box-shadow: 0 0 10px rgba(23,215,255,.5); }
.sidebar-version { text-align: center; margin-top: 24px; color: #31566d; font-size: 8px; letter-spacing: 1.2px; font-style: italic; }

/* ---------- Main ---------- */
.main-content { grid-column: 2; width: 100%; min-width: 0; padding: 26px 30px 42px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 0 0 20px; }
.page-heading h1 { margin: 4px 0 4px; font-size: 30px; line-height: 1; letter-spacing: -.7px; }
.page-heading p { margin: 0; color: var(--text-soft); font-size: 12px; }
.eyebrow { color: #4ca8d5; font-size: 9px; font-weight: 800; letter-spacing: 1.7px; }
.context-badge { display: inline-flex; align-items: center; height: 34px; max-width: 290px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(11,29,45,.72); color: #b9cfde; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.context-badge .status-dot { flex: 0 0 auto; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 15px; }
.stat-card { min-height: 111px; display: flex; align-items: center; gap: 15px; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(135deg, rgba(14,34,52,.96), rgba(8,23,36,.97)); box-shadow: inset 0 1px 0 rgba(255,255,255,.015); }
.stat-icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid currentColor; }
.stat-icon .icon { width: 25px; height: 25px; }
.stat-icon.blue { color: #2d83ff; background: rgba(45,131,255,.12); }
.stat-icon.cyan { color: #1bc0ee; background: rgba(27,192,238,.12); }
.stat-icon.purple { color: var(--purple); background: rgba(155,108,255,.12); }
.stat-icon.orange { color: var(--orange); background: rgba(255,123,86,.12); }
.stat-card > div:last-child { min-width: 0; flex: 1; }
.stat-card span { display: block; color: #8da9bc; font-size: 9px; font-weight: 800; letter-spacing: .7px; }
.stat-card strong { display: block; margin-top: 5px; font-size: 22px; line-height: 1; }
.stat-card small { display: block; margin-top: 7px; color: #718ea3; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { height: 4px; margin-top: 9px; border-radius: 999px; background: #152c3d; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); border-radius: inherit; }
.dashboard-grid { display: grid; grid-template-columns: .92fr 1fr 1.08fr; gap: 12px; align-items: stretch; }
.panel-card { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(13,31,48,.98), rgba(7,21,33,.98)); box-shadow: inset 0 1px 0 rgba(255,255,255,.014), 0 10px 30px rgba(0,0,0,.06); }
.card-header { min-height: 49px; padding: 0 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line-soft); }
.card-header > div { display: flex; align-items: center; gap: 9px; }
.card-header h2 { margin: 0; font-size: 13px; }
.small-link { height: 27px; display: inline-flex; align-items: center; padding: 0 9px; border: 1px solid #25465c; border-radius: 7px; color: #95bad1; background: rgba(12,34,51,.7); font-size: 9px; font-weight: 700; }
.small-link:hover { color: #fff; border-color: #34759b; }
.small-muted { color: #668399; font-size: 9px; }
.bot-status-hero { min-height: 118px; padding: 17px; display: flex; align-items: center; justify-content: space-between; background: radial-gradient(circle at 80% 50%, rgba(20,118,255,.12), transparent 42%), linear-gradient(180deg, rgba(15,39,59,.4), rgba(8,23,35,.2)); border-bottom: 1px solid var(--line-soft); }
.online-title { display: flex; align-items: center; font-size: 16px; }
.online-title strong { font-size: 16px; }
.bot-status-hero p { margin: 5px 0 0 13px; color: #7593a7; font-size: 9.5px; }
.mini-bot { width: 100px; height: 80px; position: relative; display: grid; place-items: center; }
.mini-bot::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 6px; height: 13px; border: 2px solid rgba(29,183,255,.55); border-radius: 50%; box-shadow: 0 0 24px rgba(20,118,255,.4), inset 0 0 12px rgba(20,118,255,.18); }
.mini-bot span { width: 59px; height: 59px; display: grid; place-items: center; color: #5bd3ff; border-radius: 24px; background: linear-gradient(145deg, #173d61, #0a1c2c); box-shadow: 0 0 22px rgba(20,118,255,.22); transform: translateY(-3px); }
.mini-bot img { width: 55px; height: 55px; border-radius: 19px; object-fit: cover; }
.overview-list { padding: 0 13px 8px; }
.overview-list > div { min-height: 37px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line-soft); font-size: 10px; }
.overview-list > div:last-child { border-bottom: 0; }
.overview-list span { color: #7d9aaf; }
.overview-list strong { font-size: 10px; text-align: right; word-break: break-all; }
.positive { color: var(--green); }
.positive i, .warning-text i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; background: currentColor; vertical-align: middle; }
.warning-text { color: var(--yellow) !important; }
.compact-form { padding: 13px 14px 5px; display: grid; gap: 7px; }
.compact-form label { display: grid; grid-template-columns: 94px minmax(0,1fr); align-items: center; gap: 9px; }
.compact-form label > span { color: #8ca6b9; font-size: 9px; }
input, textarea, select { width: 100%; border: 1px solid #234359; border-radius: 7px; outline: none; color: #d8e5ef; background: #091827; transition: border-color .15s, box-shadow .15s; }
input { height: 35px; padding: 0 10px; }
textarea { padding: 9px 10px; resize: vertical; line-height: 1.45; }
select { height: 38px; padding: 0 10px; appearance: auto; }
input:focus, textarea:focus, select:focus { border-color: #287fb2; box-shadow: 0 0 0 3px rgba(20,118,255,.08); }
input[readonly], textarea[readonly], select:disabled { color: #91a9bb; background: #091624; cursor: default; }
.compact-form input { height: 30px; font-size: 9.5px; }
.compact-form textarea { height: 58px; min-height: 58px; resize: none; font-size: 9.5px; }
.color-input-static { height: 30px; display: flex; align-items: center; gap: 8px; padding: 0 8px; border: 1px solid #234359; border-radius: 7px; background: #091827; color: #c7d9e7; font-size: 9.5px; }
.color-input-static i { width: 18px; height: 18px; border-radius: 4px; border: 1px solid rgba(255,255,255,.2); }
.btn { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; border: 1px solid transparent; border-radius: 8px; font-weight: 750; font-size: 11px; cursor: pointer; transition: transform .15s, border-color .15s, background .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { border-color: #1c8fd2; color: #fff; background: linear-gradient(135deg, #0e71c8, #0c9ed3); box-shadow: 0 0 20px rgba(20,118,255,.12); }
.btn-primary:hover { border-color: #4bc9ff; box-shadow: 0 0 24px rgba(20,118,255,.2); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-wide { width: 100%; }
.btn-card { float: right; margin: 4px 14px 13px; min-height: 33px; }
.module-list { padding: 3px 14px 9px; }
.module-row { min-height: 47px; display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 9px; border-bottom: 1px solid var(--line-soft); }
.module-row:last-child { border-bottom: 0; }
.module-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; color: #58bfff; background: rgba(20,118,255,.13); }
.module-icon .icon { width: 15px; height: 15px; }
.module-copy { min-width: 0; }
.module-copy strong, .module-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.module-copy strong { font-size: 10.5px; }
.module-copy small { margin-top: 3px; color: #718da2; font-size: 8.7px; }
.status-pill { display: inline-flex; align-items: center; justify-content: center; min-height: 25px; padding: 0 9px; border: 1px solid #294558; border-radius: 7px; color: #819bad; background: #0b1b29; font-size: 8.5px; font-weight: 700; }
.status-pill.enabled { color: #32e6a9; border-color: rgba(34,217,154,.35); background: rgba(34,217,154,.07); }
.status-pill.disabled { color: #7892a5; }
.status-pill.draft { color: #5ecbff; border-color: rgba(29,183,255,.3); background: rgba(29,183,255,.07); }
.activity-card { margin-top: 12px; }
.activity-list { padding: 0 14px 7px; }
.activity-row { min-height: 52px; display: grid; grid-template-columns: 31px minmax(0,1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--line-soft); color: #9eb5c6; font-size: 9.5px; }
.activity-row:last-child { border-bottom: 0; }
.activity-row .avatar { width: 30px; height: 30px; }
.activity-row strong { color: #eef7fd; }
.activity-row small { display: block; margin-top: 3px; color: #657f92; }
.activity-row time { color: #6e8ba0; font-size: 9px; white-space: nowrap; }
.activity-empty { padding: 22px 15px; color: var(--text-muted); font-size: 11px; }

/* ---------- Settings / Generic pages ---------- */
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.settings-main-card { min-width: 0; }
.settings-form { padding: 18px; display: grid; gap: 17px; }
.field { display: block; }
.field > span { display: block; margin-bottom: 5px; color: #d6e3ec; font-size: 11px; font-weight: 700; }
.field > small { display: block; margin: -1px 0 8px; color: #718b9f; font-size: 9.5px; line-height: 1.45; }
.form-grid { display: grid; gap: 12px; }
.form-grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.color-field { display: grid; grid-template-columns: 47px minmax(0,1fr); gap: 8px; }
.color-field input[type=color] { padding: 3px; cursor: pointer; }
.form-actions { min-height: 62px; padding: 12px 18px; border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.save-note { color: #718b9f; font-size: 9.5px; }
.settings-side { display: grid; gap: 14px; }
.info-card { padding: 16px; }
.info-card h3 { margin: 7px 0 7px; font-size: 14px; }
.info-card > p { color: #7f9aae; line-height: 1.55; font-size: 10.5px; }
.settings-server-profile { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.settings-server-profile img, .settings-server-profile > span { width: 50px; height: 50px; border-radius: 50%; border: 1px solid #2b5873; }
.settings-server-profile > span { display: grid; place-items: center; background: #123454; font-weight: 800; }
.settings-server-profile h3 { margin: 0 0 4px; }
.settings-server-profile p { margin: 0; color: #7691a4; font-size: 10px; }
.info-list { margin: 16px 0 0; }
.info-list > div { min-height: 37px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line-soft); font-size: 9.5px; }
.info-list dt { color: #7893a7; }
.info-list dd { margin: 0; color: #d2e1eb; text-align: right; word-break: break-all; }
.coming-card, .empty-server-state, .error-card { min-height: 390px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 38px; background: radial-gradient(circle at 50% 45%, rgba(20,118,255,.09), transparent 18rem), linear-gradient(145deg, rgba(13,31,48,.98), rgba(7,21,33,.98)); }
.coming-card h2, .empty-server-state h2, .error-card h2 { max-width: 650px; margin: 8px 0; font-size: 23px; }
.coming-card p, .empty-server-state p, .error-card p { max-width: 610px; margin: 0 0 20px; color: #7f9aae; line-height: 1.6; }
.coming-icon, .empty-server-icon, .error-code { width: 66px; height: 66px; display: grid; place-items: center; margin-bottom: 16px; border: 1px solid #256388; border-radius: 20px; color: #54c5ff; background: rgba(20,118,255,.1); box-shadow: 0 0 28px rgba(20,118,255,.1); }
.coming-icon .icon, .empty-server-icon .icon { width: 31px; height: 31px; }
.coming-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.coming-tags span { padding: 6px 9px; border: 1px solid #244257; border-radius: 999px; color: #7897ac; background: #091926; font-size: 9px; }
.error-code { color: var(--red); border-color: rgba(255,93,108,.35); background: rgba(255,93,108,.07); font-size: 30px; font-weight: 900; }
code { color: #74d2ff; background: #081621; padding: 2px 5px; border-radius: 5px; }

/* ---------- Alerts ---------- */
.alert { margin: 0 0 14px; padding: 11px 13px; border: 1px solid #28506b; border-radius: 9px; color: #bdd4e4; background: rgba(19,57,81,.35); font-size: 10.5px; line-height: 1.5; }
.alert-success { border-color: rgba(34,217,154,.35); color: #8eedca; background: rgba(34,217,154,.07); }
.alert-error { border-color: rgba(255,93,108,.38); color: #ffb0b9; background: rgba(255,93,108,.07); }
.alert-warning { border-color: rgba(244,200,90,.35); color: #f6dc96; background: rgba(244,200,90,.06); }

/* ---------- Auth / Installer ---------- */
.auth-body { min-height: 100vh; overflow-x: hidden; background: #030b13; }
.auth-grid { position: fixed; inset: 0; opacity: .22; background-image: linear-gradient(rgba(38,87,117,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(38,87,117,.12) 1px, transparent 1px); background-size: 34px 34px; mask-image: radial-gradient(circle at center, black, transparent 75%); }
.auth-glow { position: fixed; border-radius: 50%; filter: blur(20px); pointer-events: none; }
.auth-glow-one { width: 500px; height: 500px; left: -180px; top: -180px; background: rgba(20,118,255,.12); }
.auth-glow-two { width: 450px; height: 450px; right: -180px; bottom: -180px; background: rgba(23,215,255,.08); }
.auth-shell { position: relative; z-index: 2; min-height: 100vh; max-width: 1080px; margin: 0 auto; padding: 44px 28px; display: grid; grid-template-columns: minmax(0, 520px) minmax(320px, 1fr); align-items: center; gap: 50px; }
.auth-shell-single { display: flex; justify-content: center; }
.login-card, .installer-card { border: 1px solid #17364c; border-radius: 18px; background: linear-gradient(145deg, rgba(11,28,43,.97), rgba(5,16,26,.98)); box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.015); }
.login-card { padding: 30px; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand-centered { margin-bottom: 34px; }
.tobi-mark { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid #2d6f96; border-radius: 14px; color: #55cdff; background: linear-gradient(135deg, rgba(20,118,255,.18), rgba(23,215,255,.04)); box-shadow: 0 0 24px rgba(20,118,255,.1); }
.tobi-mark-large { width: 55px; height: 55px; border-radius: 17px; }
.tobi-mark img { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; }
.tobi-mark-large img { width: 49px; height: 49px; border-radius: 15px; }
.auth-brand div strong, .auth-brand div span { display: block; }
.auth-brand div strong { font-size: 19px; }
.auth-brand div span { margin-top: 3px; color: #718da2; font-size: 9px; letter-spacing: .3px; }
.login-copy h1 { margin: 8px 0 10px; font-size: 34px; line-height: 1.1; letter-spacing: -1px; }
.login-copy h1 span { color: #54c8ff; }
.login-copy p { margin: 0 0 22px; color: #819bae; line-height: 1.6; font-size: 11px; }
.discord-login-button { min-height: 50px; display: grid; grid-template-columns: 30px 1fr 20px; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid #7480ff; border-radius: 10px; color: white; background: linear-gradient(135deg, #4f5be2, #5865f2); box-shadow: 0 10px 28px rgba(88,101,242,.18); font-weight: 800; }
.discord-login-button:hover { background: linear-gradient(135deg, #5865f2, #6672ff); }
.discord-mark { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,.12); font-size: 18px; }
.login-arrow { text-align: right; font-size: 18px; }
.login-features { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px 14px; color: #657f93; font-size: 8.7px; }
.login-features span { display: flex; align-items: center; gap: 5px; }
.login-features i { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.login-visual { min-height: 520px; position: relative; display: grid; place-items: center; }
.visual-core { width: 190px; height: 190px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(29,183,255,.28); background: radial-gradient(circle, rgba(20,118,255,.18), rgba(5,17,29,.2) 60%, transparent 61%); box-shadow: 0 0 80px rgba(20,118,255,.13); }
.visual-bot { width: 104px; height: 104px; display: grid; place-items: center; border: 1px solid #2f83b2; border-radius: 36px; color: #5dd4ff; background: linear-gradient(145deg, #123e61, #081928); box-shadow: 0 0 45px rgba(20,118,255,.28); }
.visual-bot img { width: 92px; height: 92px; border-radius: 30px; object-fit: cover; }
.visual-orbit { position: absolute; border: 1px solid rgba(29,183,255,.2); border-radius: 50%; transform: rotate(-14deg); }
.orbit-one { width: 310px; height: 165px; }
.orbit-two { width: 390px; height: 220px; transform: rotate(26deg); opacity: .5; }
.visual-node { position: absolute; width: 11px; height: 11px; border: 2px solid #7be1ff; border-radius: 50%; background: #0b1d2c; box-shadow: 0 0 16px rgba(23,215,255,.7); }
.node-a { transform: translate(146px, -68px); }.node-b { transform: translate(-176px, 24px); }.node-c { transform: translate(95px, 105px); }

.installer-shell { position: relative; z-index: 2; max-width: 920px; margin: 0 auto; padding: 38px 24px 70px; }
.installer-card { padding: 28px; }
.installer-heading { margin: 28px 0 20px; }
.installer-heading h1 { margin: 8px 0 8px; font-size: 28px; }
.installer-heading p { margin: 0; color: #819bae; line-height: 1.6; font-size: 10.5px; }
.requirements-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 7px; margin: 17px 0 23px; }
.requirement { min-height: 38px; display: flex; align-items: center; gap: 7px; padding: 0 9px; border: 1px solid #213f52; border-radius: 8px; background: #081825; color: #839eb1; font-size: 8.5px; }
.requirement span { width: 17px; height: 17px; display: grid; place-items: center; border-radius: 50%; font-size: 9px; }
.requirement.ok span { color: #9cf4d3; background: rgba(34,217,154,.12); }.requirement.bad span { color: #ffb0b9; background: rgba(255,93,108,.12); }
.installer-form { display: grid; gap: 13px; }
.form-section-title { margin: 13px 0 2px; padding-top: 16px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; gap: 11px; }
.form-section-title > span { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #285e7e; border-radius: 8px; color: #55c9ff; background: rgba(20,118,255,.08); font-size: 9px; font-weight: 800; }
.form-section-title strong, .form-section-title small { display: block; }.form-section-title strong { font-size: 12px; }.form-section-title small { margin-top: 3px; color: #6f8a9d; font-size: 8.8px; }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .dashboard-grid { grid-template-columns: 1fr 1fr; }
    .modules-card { grid-column: 1 / -1; }
    .module-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
}
@media (max-width: 980px) {
    :root { --sidebar: 225px; }
    .main-content { padding: 22px 20px 35px; }
    .settings-layout { grid-template-columns: 1fr; }
    .settings-side { grid-template-columns: 1fr 1fr; }
    .auth-shell { grid-template-columns: 1fr; max-width: 620px; }
    .login-visual { display: none; }
    .requirements-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 760px) {
    :root { --topbar: 64px; }
    .brand { width: auto; padding: 0 14px; border-right: 0; }.brand-name { display: none; }.switcher { margin-left: 6px; }.switcher-button { min-width: 130px; }.profile { margin-right: 7px; }.profile-button { min-width: 0; }.profile-button > span { display: none; }
    .app-shell { display: block; }.sidebar { position: static; width: 100%; height: auto; max-height: none; border-right: 0; border-bottom: 1px solid var(--line-soft); }.main-content { padding: 18px 14px 30px; }.sidebar-nav { display: none; }.sidebar-version { display: none; }
    .server-menu { width: min(92vw, 320px); }
    .stats-grid, .dashboard-grid, .settings-side, .form-grid-2, .module-list { grid-template-columns: 1fr; }.modules-card { grid-column: auto; }.page-heading { align-items: flex-start; flex-direction: column; }.context-badge { max-width: 100%; }.settings-layout { display: block; }.settings-side { margin-top: 12px; }.form-actions { align-items: stretch; flex-direction: column; }.form-actions .btn { width: 100%; }.compact-form label { grid-template-columns: 1fr; gap: 4px; }
    .auth-shell, .installer-shell { padding: 20px 12px; }.login-card, .installer-card { padding: 20px; }.login-copy h1 { font-size: 29px; }.requirements-grid { grid-template-columns: 1fr 1fr; }
}


/* ---------- v0.0.2 Readability Scale ---------- */
/* Keep the original Dark KXON composition while making all operational text comfortably readable. */
:root {
    --sidebar: 285px;
    --topbar: 78px;
}
body { font-size: 15px; }
.brand-name { font-size: 23px; }
.switcher-button, .profile-button { font-size: 14px; }
.dropdown-menu > a, .dropdown-disabled, .logout-link { font-size: 14px; }
.dropdown-disabled small { font-size: 12px; }
.profile-summary strong { font-size: 14px; }
.profile-summary small { font-size: 12px; }

.server-card { min-height: 68px; }
.server-info strong { font-size: 14px; }
.server-info small { font-size: 12px; }
.server-menu-title { font-size: 10.5px; }
.server-option strong { font-size: 13px; }
.server-option small { font-size: 11px; }
.server-menu-empty { font-size: 13px; }
.refresh-servers-button { min-height: 42px; font-size: 13px; }
.add-server-button { min-height: 42px; font-size: 13px; }
.nav-section-toggle { height: 32px; font-size: 10.5px; }
.nav-link { height: 37px; font-size: 13px; }
.sidebar-version { font-size: 10px; }

.main-content { padding-top: 30px; }
.page-heading h1 { font-size: 34px; }
.page-heading p { font-size: 14px; }
.eyebrow { font-size: 10.5px; }
.context-badge { height: 38px; font-size: 13px; }

.stat-card span { font-size: 10.5px; }
.stat-card strong { font-size: 25px; }
.stat-card small { font-size: 11px; }
.card-header h2 { font-size: 15px; }
.small-link { height: 31px; font-size: 11px; }
.small-muted { font-size: 11px; }
.online-title, .online-title strong { font-size: 18px; }
.bot-status-hero p { font-size: 11.5px; }
.overview-list > div { min-height: 42px; font-size: 12.5px; }
.overview-list strong { font-size: 12.5px; }

.compact-form label > span { font-size: 11.5px; }
.compact-form input { height: 35px; font-size: 12px; }
.compact-form textarea { height: 68px; min-height: 68px; font-size: 12px; line-height: 1.45; }
.color-input-static { height: 35px; font-size: 12px; }
.btn { min-height: 42px; font-size: 13px; }

.module-copy strong { font-size: 12.5px; }
.module-copy small { font-size: 10.8px; line-height: 1.35; }
.status-pill { min-height: 28px; font-size: 10.5px; }
.activity-row { min-height: 58px; font-size: 11.5px; }
.activity-row time { font-size: 11px; }
.activity-empty { font-size: 13px; }

.field > span { font-size: 13px; }
.field > small { font-size: 11.5px; }
.field input, .field textarea, .field select { font-size: 13px; }
.save-note { font-size: 11.5px; }
.info-card h3 { font-size: 16px; }
.info-card > p { font-size: 12.5px; }
.settings-server-profile p { font-size: 12px; }
.info-list > div { min-height: 42px; font-size: 11.5px; }

.coming-card h2, .empty-server-state h2, .error-card h2 { font-size: 26px; }
.coming-card p, .empty-server-state p, .error-card p { font-size: 13px; }
.coming-tags span { font-size: 11px; }
.alert { font-size: 12.5px; }

.auth-brand div strong { font-size: 21px; }
.auth-brand div span { font-size: 11px; }
.login-copy h1 { font-size: 38px; }
.login-copy p { font-size: 13px; }
.discord-login-button { font-size: 14px; }
.login-features { font-size: 10.5px; }
.installer-heading h1 { font-size: 31px; }
.installer-heading p { font-size: 12.5px; }
.requirement { min-height: 42px; font-size: 10.5px; }
.requirement span { font-size: 10.5px; }
.form-section-title > span { font-size: 10.5px; }
.form-section-title strong { font-size: 14px; }
.form-section-title small { font-size: 10.5px; }

@media (max-width: 980px) {
    :root { --sidebar: 250px; }
}
@media (max-width: 760px) {
    :root { --topbar: 66px; }
    .page-heading h1 { font-size: 30px; }
    .login-copy h1 { font-size: 32px; }
}

/* ---------- v0.0.4 KXON Application Switcher ---------- */
.app-switcher-menu {
    width: 344px;
    min-width: 344px;
    padding: 11px;
    border-color: #1d4057;
    border-radius: 15px;
    background: linear-gradient(155deg, rgba(8,25,39,.995), rgba(5,17,28,.995));
    box-shadow: 0 26px 60px rgba(0,0,0,.46), inset 0 1px 0 rgba(255,255,255,.02);
}
.app-switcher-heading {
    padding: 4px 9px 9px;
    color: #658ca8;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 1.35px;
}
.dropdown-menu > a.app-switcher-item {
    min-height: 70px;
    justify-content: flex-start;
    gap: 13px;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #d7e6f1;
}
.dropdown-menu > a.app-switcher-item + a.app-switcher-item { margin-top: 4px; }
.dropdown-menu > a.app-switcher-item:hover {
    border-color: #254b64;
    background: rgba(18,48,70,.82);
}
.dropdown-menu > a.app-switcher-item.selected {
    border-color: rgba(38,137,255,.48);
    background: linear-gradient(135deg, rgba(20,118,255,.18), rgba(10,54,88,.28));
    box-shadow: inset 3px 0 0 #2498ff, 0 0 24px rgba(20,118,255,.06);
}
.app-switcher-icon {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 8px 22px rgba(0,0,0,.16);
}
.app-switcher-icon .icon { width: 23px; height: 23px; }
.app-switcher-icon.portal { background: linear-gradient(145deg, #176ef1, #1455c9); }
.app-switcher-icon.tobi { background: linear-gradient(145deg, #123d61, #08253d); color: #66d7ff; }
.app-switcher-icon.tobi .icon { width: 29px; height: 29px; }
.app-switcher-icon.website { background: linear-gradient(145deg, #20c6a8, #15977f); }
.app-switcher-copy { min-width: 0; display: block; text-align: left; }
.app-switcher-copy strong,
.app-switcher-copy small { display: block; }
.app-switcher-copy strong { color: #f3f9fd; font-size: 14px; line-height: 1.2; }
.app-switcher-copy small { margin-top: 6px; color: #7995a9; font-size: 11.5px; line-height: 1.25; }

/* ---------- v0.0.4 Join & Leave ---------- */
.join-leave-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 13px;
    margin-bottom: 14px;
}
.event-summary-card {
    min-height: 88px;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(12,31,47,.96), rgba(7,21,33,.96));
    opacity: .82;
    transition: border-color .18s, opacity .18s, transform .18s;
}
.event-summary-card.enabled { opacity: 1; border-color: #285b78; }
.event-summary-card:hover { transform: translateY(-1px); }
.event-summary-icon,
.event-config-icon,
.channel-sync-icon {
    display: grid;
    place-items: center;
    border: 1px solid;
    border-radius: 13px;
}
.event-summary-icon { width: 48px; height: 48px; flex: 0 0 48px; }
.event-summary-icon .icon { width: 23px; height: 23px; }
.event-summary-icon.blue, .event-config-icon.blue { color: #4bbcff; border-color: rgba(37,143,221,.55); background: rgba(20,118,255,.12); }
.event-summary-icon.slate, .event-config-icon.slate { color: #9cb5c8; border-color: rgba(111,143,166,.42); background: rgba(111,143,166,.09); }
.event-summary-icon.pink, .event-config-icon.pink { color: #ee87ff; border-color: rgba(212,92,235,.42); background: rgba(212,92,235,.09); }
.event-summary-card > span:last-child { min-width: 0; }
.event-summary-card small,
.event-summary-card strong,
.event-summary-card em { display: block; }
.event-summary-card small { color: #6489a2; font-size: 10px; font-weight: 850; letter-spacing: 1.1px; }
.event-summary-card strong { margin-top: 3px; color: #edf7fd; font-size: 16px; }
.event-summary-card em { margin-top: 5px; overflow: hidden; color: #7693a8; font-size: 11px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }

.channel-sync-notice {
    min-height: 66px;
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 14px;
    padding: 11px 14px;
    border: 1px solid rgba(244,200,90,.27);
    border-radius: 11px;
    background: linear-gradient(135deg, rgba(244,200,90,.055), rgba(20,118,255,.04));
}
.channel-sync-icon { width: 39px; height: 39px; flex: 0 0 39px; color: #f6d778; border-color: rgba(244,200,90,.3); background: rgba(244,200,90,.07); }
.channel-sync-icon .icon { width: 18px; height: 18px; }
.channel-sync-notice strong,
.channel-sync-notice small { display: block; }
.channel-sync-notice strong { color: #e8f1f7; font-size: 13px; }
.channel-sync-notice small { margin-top: 4px; color: #809aad; font-size: 11.5px; line-height: 1.45; }

.join-leave-form { display: grid; gap: 14px; padding-bottom: 30px; }
.event-config-card { overflow: hidden; }
.event-config-header {
    min-height: 82px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line-soft);
    background: linear-gradient(90deg, rgba(19,52,74,.22), transparent 55%);
}
.event-config-icon { width: 48px; height: 48px; }
.event-config-icon .icon { width: 22px; height: 22px; }
.event-config-title h2 { margin: 2px 0 3px; color: #f2f8fc; font-size: 18px; }
.event-config-title p { margin: 0; color: #7690a3; font-size: 11.5px; }
.event-config-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.event-settings-column,
.event-embed-column { min-width: 0; padding: 18px; display: grid; align-content: start; gap: 15px; }
.event-settings-column { border-right: 1px solid var(--line-soft); }
.event-embed-column { background: rgba(4,14,23,.18); }

.toggle-control { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.toggle-control input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.toggle-track {
    width: 46px;
    height: 25px;
    position: relative;
    flex: 0 0 46px;
    border: 1px solid #315269;
    border-radius: 999px;
    background: #0a1a27;
    transition: border-color .18s, background .18s, box-shadow .18s;
}
.toggle-track i {
    width: 17px;
    height: 17px;
    position: absolute;
    top: 3px;
    left: 4px;
    border-radius: 50%;
    background: #7590a3;
    transition: transform .18s, background .18s;
}
.toggle-control input:checked + .toggle-track {
    border-color: #198bcf;
    background: linear-gradient(135deg, #0d67b5, #0ba3d5);
    box-shadow: 0 0 17px rgba(20,118,255,.14);
}
.toggle-control input:checked + .toggle-track i { transform: translateX(19px); background: #fff; }
.toggle-control strong { color: #a9bfce; font-size: 12px; }
.toggle-control input:checked ~ strong { color: #e7f7ff; }
.toggle-compact strong { display: none; }
.toggle-compact .toggle-track { width: 40px; height: 22px; flex-basis: 40px; }
.toggle-compact .toggle-track i { width: 14px; height: 14px; }
.toggle-compact input:checked + .toggle-track i { transform: translateX(17px); }

.subsection-heading { min-height: 35px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 9px; border-bottom: 1px solid var(--line-soft); }
.subsection-heading strong,
.subsection-heading small { display: block; }
.subsection-heading strong { color: #dce9f2; font-size: 14px; }
.subsection-heading small { margin-top: 3px; color: #6f8ba0; font-size: 10.5px; }

.variable-box { padding: 11px; border: 1px solid #1d3b50; border-radius: 9px; background: rgba(4,14,23,.28); }
.variable-box > span { display: block; margin-bottom: 8px; color: #7492a7; font-size: 10.5px; font-weight: 750; }
.variable-box.compact { padding: 9px 10px; }
.variable-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.variable-chip {
    min-height: 29px;
    padding: 0 9px;
    border: 1px solid #28516a;
    border-radius: 7px;
    color: #74d2ff;
    background: #081a29;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 10.5px;
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .15s;
}
.variable-chip:hover { border-color: #2f8cc2; background: #0c2639; transform: translateY(-1px); }
.field-counter { display: block; margin-top: 5px; color: #58758a; font-size: 10px; text-align: right; }
[data-hex-color] { text-transform: uppercase; }

.join-leave-savebar {
    position: sticky;
    bottom: 14px;
    z-index: 15;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 13px 16px;
    border-color: #28536e;
    background: rgba(7,23,36,.96);
    backdrop-filter: blur(14px);
    box-shadow: 0 14px 38px rgba(0,0,0,.24);
}
.join-leave-savebar strong,
.join-leave-savebar small { display: block; }
.join-leave-savebar strong { color: #eaf5fb; font-size: 13px; }
.join-leave-savebar small { margin-top: 4px; color: #7591a5; font-size: 11px; }

@media (max-width: 1100px) {
    .event-config-body { grid-template-columns: 1fr; }
    .event-settings-column { border-right: 0; border-bottom: 1px solid var(--line-soft); }
}
@media (max-width: 880px) {
    .join-leave-summary-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .app-switcher-menu { width: min(92vw, 344px); min-width: 0; }
    .event-config-header { grid-template-columns: 42px minmax(0, 1fr); }
    .event-config-icon { width: 42px; height: 42px; }
    .event-config-header > .toggle-control { grid-column: 1 / -1; justify-self: start; }
    .event-settings-column, .event-embed-column { padding: 15px; }
    .join-leave-savebar { position: static; align-items: stretch; flex-direction: column; }
    .join-leave-savebar .btn { width: 100%; }
}

/* ---------- v0.0.8 Server selector overflow fix ---------- */
.sidebar {
    overflow-x: hidden;
}
.server-zone {
    min-width: 0;
}
.server-menu {
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
}
.server-menu .dropdown-separator {
    margin-left: 7px;
    margin-right: 7px;
}
.dropdown-menu > a.add-server-menu {
    width: 100%;
    min-width: 0;
    min-height: 64px;
    display: grid !important;
    grid-template-columns: 30px minmax(0, 1fr) 14px;
    align-items: center;
    justify-content: initial;
    gap: 9px;
    padding: 9px 8px;
}
.add-server-menu-icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: #54c6ff;
    background: rgba(20,118,255,.1);
}
.add-server-menu-icon .icon {
    width: 16px;
    height: 16px;
}
.add-server-menu-copy {
    min-width: 0;
    display: block;
}
.add-server-menu-copy strong,
.add-server-menu-copy small {
    display: block;
    max-width: 100%;
}
.add-server-menu-copy strong {
    color: #dff5ff;
    font-size: 13px;
    line-height: 1.2;
}
.add-server-menu-copy small {
    margin-top: 4px;
    color: #7593a8;
    font-size: 10.5px;
    font-weight: 500;
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: anywhere;
}
.add-server-menu-arrow {
    justify-self: end;
    color: #4ca8d5;
}
.server-option,
.refresh-servers-button,
.server-menu-empty {
    max-width: 100%;
}

/* ---------- v0.0.8 Servers page ---------- */
.server-page-heading .context-badge {
    color: #a9dfff;
}
.server-connect-intro {
    min-height: 108px;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
    padding: 18px 20px;
}
.server-connect-intro-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border: 1px solid #246b97;
    border-radius: 16px;
    color: #53c8ff;
    background: linear-gradient(145deg, rgba(20,118,255,.18), rgba(17,183,255,.06));
    box-shadow: inset 0 0 18px rgba(29,183,255,.06);
}
.server-connect-intro-icon .icon {
    width: 25px;
    height: 25px;
}
.server-connect-intro-copy {
    min-width: 0;
}
.server-connect-intro-copy h2 {
    margin: 3px 0 5px;
    font-size: 19px;
}
.server-connect-intro-copy p {
    margin: 0;
    color: #819caf;
    font-size: 12.5px;
    line-height: 1.45;
}
.server-page-refresh {
    margin: 0;
}
.server-connect-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.server-connect-card {
    min-width: 0;
    padding: 17px;
    transition: border-color .18s, transform .18s, box-shadow .18s;
}
.server-connect-card:hover {
    transform: translateY(-1px);
    border-color: #285b78;
    box-shadow: 0 14px 35px rgba(0,0,0,.16);
}
.server-connect-card.connected {
    border-color: rgba(34,217,154,.25);
}
.server-connect-card-top {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}
.server-connect-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #2b5d7b;
    background: #0b2438;
}
.server-connect-fallback {
    display: grid;
    place-items: center;
    color: #e0f5ff;
    font-size: 13px;
    font-weight: 850;
    background: linear-gradient(145deg, #154f89, #0b2b48);
}
.server-connect-copy {
    min-width: 0;
}
.server-connect-copy strong,
.server-connect-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.server-connect-copy strong {
    color: #f0f8fd;
    font-size: 15px;
}
.server-connect-copy small {
    margin-top: 4px;
    color: #7491a5;
    font-size: 11.5px;
}
.server-connection-status {
    min-height: 25px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    border: 1px solid;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 750;
    white-space: nowrap;
}
.server-connection-status i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.server-connection-status.available {
    color: #78cfff;
    border-color: rgba(53,167,225,.35);
    background: rgba(20,118,255,.07);
}
.server-connection-status.available i {
    background: #29baff;
    box-shadow: 0 0 9px rgba(41,186,255,.4);
}
.server-connection-status.connected {
    color: #6be7b8;
    border-color: rgba(34,217,154,.28);
    background: rgba(34,217,154,.06);
}
.server-connection-status.connected i {
    background: var(--green);
    box-shadow: 0 0 9px rgba(34,217,154,.45);
}
.server-connect-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin: 15px 0;
    padding: 11px 0;
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
}
.server-connect-meta span {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    color: #7693a7;
    font-size: 10.5px;
}
.server-connect-meta .icon {
    width: 14px;
    height: 14px;
    color: #43bfff;
}
.server-connect-actions,
.server-connect-actions form {
    margin: 0;
}
.server-connect-actions .btn {
    width: 100%;
    justify-content: center;
}
.server-page-note {
    min-height: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 10px 13px;
    border: 1px solid #173d56;
    border-radius: 10px;
    color: #7f9caf;
    background: rgba(8,24,37,.72);
    font-size: 11.5px;
}
.server-page-note .icon {
    color: #42bfff;
}
.server-page-note strong {
    color: #cde2ef;
}
.server-empty-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}
.server-empty-actions form {
    margin: 0;
}
.server-page-empty {
    min-height: 360px;
}

@media (max-width: 1220px) {
    .server-connect-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .server-connect-intro { grid-template-columns: 48px minmax(0, 1fr); }
    .server-connect-intro-icon { width: 48px; height: 48px; }
    .server-page-refresh { grid-column: 1 / -1; }
    .server-page-refresh .btn { width: 100%; justify-content: center; }
}
@media (max-width: 760px) {
    .server-connect-grid { grid-template-columns: 1fr; }
    .server-connect-card-top { grid-template-columns: 46px minmax(0, 1fr); }
    .server-connect-avatar { width: 46px; height: 46px; }
    .server-connection-status { grid-column: 1 / -1; justify-self: start; }
    .server-empty-actions { width: 100%; flex-direction: column; }
    .server-empty-actions form, .server-empty-actions .btn { width: 100%; }
}

/* ---------- v0.0.9 Server picker & secondary buttons ---------- */
.btn-secondary {
    border-color: #285a78;
    color: #bfe8ff;
    background: linear-gradient(180deg, rgba(15,43,64,.96), rgba(8,27,42,.96));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 0 18px rgba(20,118,255,.05);
}
.btn-secondary:hover {
    border-color: #3694c5;
    color: #fff;
    background: linear-gradient(180deg, rgba(18,57,84,.98), rgba(9,34,52,.98));
    box-shadow: 0 0 22px rgba(29,183,255,.10);
}
.btn-secondary .refresh-symbol { color: #35c2ff; }

.dashboard-server-intro { margin-bottom: 14px; }
.dashboard-server-grid { margin-top: 0; }
.dashboard-server-empty { min-height: 300px; }
.dashboard-server-note { position: relative; padding-right: 230px; }
.dashboard-server-all {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #55c6ff;
    font-size: 11.5px;
    font-weight: 750;
    white-space: nowrap;
}
.dashboard-server-all:hover { color: #fff; }

@media (max-width: 900px) {
    .dashboard-server-note { padding-right: 13px; flex-wrap: wrap; }
    .dashboard-server-all { position: static; transform: none; margin-left: auto; }
}
