
/* ============================================================
   WS CHECKER v6 — Professional UI
   Clean design system: tokens, base, layout, components.
   All legacy classes/ids are restyled here; JS is untouched.
   ============================================================ */

/* ---------- Theme tokens ---------- */
[data-theme="cyber"] {
    color-scheme: dark;
    --bg: #0b0f14;
    --bg2: #121922;
    --bg3: #1a232e;
    --border: #27323f;
    --accent: #21c56a;
    --accent2: #38a7f5;
    --accent3: #ef476f;
    --accent-gold: #e5a63b;
    --text: #e8eef4;
    --text2: #8fa0b1;
    --btn-ink: #05180d;
    --glow: 0 0 0 rgba(0,0,0,0);
    --dot-color: transparent;
    --header-bg: rgba(11, 15, 20, 0.82);
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.18);
    --shadow-lg: 0 24px 70px rgba(0,0,0,.45);
}
[data-theme="ocean"] {
    color-scheme: dark;
    --bg: #071019;
    --bg2: #0d1b28;
    --bg3: #142636;
    --border: #1e3a52;
    --accent: #2aa8e8;
    --accent2: #59c6ff;
    --accent3: #ff7a59;
    --accent-gold: #f4c95d;
    --text: #e2eef7;
    --text2: #7f9cb5;
    --btn-ink: #04131f;
    --glow: 0 0 0 rgba(0,0,0,0);
    --dot-color: transparent;
    --header-bg: rgba(7, 16, 25, 0.82);
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.18);
    --shadow-lg: 0 24px 70px rgba(0,0,0,.45);
}
[data-theme="crimson"] {
    color-scheme: dark;
    --bg: #120a0d;
    --bg2: #1b1014;
    --bg3: #25171c;
    --border: #3a222b;
    --accent: #ff5468;
    --accent2: #ff8f6b;
    --accent3: #ff2e4d;
    --accent-gold: #f2b544;
    --text: #fbe9ec;
    --text2: #b28a93;
    --btn-ink: #1f0208;
    --glow: 0 0 0 rgba(0,0,0,0);
    --dot-color: transparent;
    --header-bg: rgba(18, 10, 13, 0.84);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.2);
    --shadow-lg: 0 24px 70px rgba(0,0,0,.5);
}
[data-theme="purple"] {
    color-scheme: dark;
    --bg: #0e0a16;
    --bg2: #171126;
    --bg3: #201838;
    --border: #342850;
    --accent: #9d7bf5;
    --accent2: #7ea2ff;
    --accent3: #ff5d8f;
    --accent-gold: #f0c05a;
    --text: #efe9fb;
    --text2: #a491c9;
    --btn-ink: #140a24;
    --glow: 0 0 0 rgba(0,0,0,0);
    --dot-color: transparent;
    --header-bg: rgba(14, 10, 22, 0.84);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.22);
    --shadow-lg: 0 24px 70px rgba(0,0,0,.5);
}
[data-theme="light"] {
    color-scheme: light;
    --bg: #f2f5f8;
    --bg2: #ffffff;
    --bg3: #edf1f5;
    --border: #d9e1e9;
    --accent: #0e9f6e;
    --accent2: #2f7dd1;
    --accent3: #e11d48;
    --accent-gold: #c9861c;
    --text: #141b26;
    --text2: #5c6b7a;
    --btn-ink: #ffffff;
    --glow: 0 0 0 rgba(0,0,0,0);
    --dot-color: transparent;
    --header-bg: rgba(255,255,255,0.85);
    --shadow: 0 1px 2px rgba(20,30,50,.06), 0 6px 20px rgba(20,30,50,.07);
    --shadow-lg: 0 24px 60px rgba(20,30,50,.18);
}

/* ---------- Base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background .35s, color .35s;
}
[data-theme="light"] body { background: var(--bg); }
body::selection, ::selection { background: var(--accent); color: var(--btn-ink); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text2); }
::-webkit-scrollbar-track { background: transparent; }
a { color: var(--accent2); text-decoration: none; }
code, pre, kbd, .mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.25; }

/* ---------- Layout shell ---------- */
.shell { max-width: 1560px; margin: 0 auto; padding: 0 20px 64px; }
header {
    position: sticky; top: 0; z-index: 120;
    display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
    margin: 0 -20px 6px; padding: 14px 22px;
    background: var(--header-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.logo { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo-icon {
    width: 40px; height: 40px; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: var(--btn-ink);
    font-weight: 800; font-size: 17px; letter-spacing: -0.5px;
    box-shadow: var(--shadow);
}
.logo-text { font-size: 19px; font-weight: 800; letter-spacing: -0.3px; line-height: 1.15; }
.logo-text span { color: var(--accent); }
.logo-sub { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 2.4px; color: var(--text2); text-transform: uppercase; font-weight: 600; margin-top: 2px; }
.header-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }

/* ---------- Header widgets ---------- */
#live-clock, #global-status {
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
    background: var(--bg3); border: 1px solid var(--border); color: var(--text2);
    padding: 7px 12px; border-radius: 9px; white-space: nowrap;
}
#global-status { color: var(--accent2); font-weight: 600; }
#btn-notif { position: relative; }
#notif-badge {
    position: absolute; top: -4px; right: -4px;
    min-width: 17px; height: 17px; padding: 0 4px;
    background: var(--accent3); color: #fff; font-size: 9px; font-weight: 700;
    border-radius: 10px; display: none; align-items: center; justify-content: center;
    font-family: 'JetBrains Mono', monospace;
}
#notif-dropdown {
    position: fixed; top: 62px; right: 18px; width: 340px; max-width: calc(100vw - 36px);
    background: var(--bg2); border: 1px solid var(--border); border-radius: 14px;
    padding: 8px; display: none; z-index: 300;
    box-shadow: var(--shadow-lg);
}
#notif-dropdown > div:first-child {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 11px; padding: 8px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px;
    color: var(--text2);
}
#notif-dropdown b { color: var(--accent); font-size: 11px; letter-spacing: .4px; }
#notif-dropdown span { cursor: pointer; color: var(--text2); font-size: 11px; }
#notif-dropdown span:hover { color: var(--text); }
#notif-list { max-height: 260px; overflow-y: auto; font-size: 12px; color: var(--text2); padding: 6px 10px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 10px 18px; border-radius: 10px;
    border: 1px solid transparent;
    font-family: inherit; font-size: 13px; font-weight: 600;
    cursor: pointer; white-space: nowrap; user-select: none;
    transition: background .18s, border-color .18s, color .18s, transform .1s, box-shadow .18s;
    line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: var(--btn-ink); width: auto; margin-top: 0; }
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-gold { background: var(--accent-gold); color: var(--btn-ink); }
.btn-gold:hover { filter: brightness(1.06); }
.btn-danger { background: transparent; border: 1px solid var(--accent3); color: var(--accent3); }
.btn-danger:hover { background: var(--accent3); color: #fff; }
.btn-ghost { background: color-mix(in srgb, var(--text) 4%, transparent); border: 1px solid var(--border); color: var(--text2); }
.btn-ghost:hover { border-color: var(--text2); color: var(--text); background: color-mix(in srgb, var(--text) 7%, transparent); }
.btn-sm { padding: 7px 13px; font-size: 12px; border-radius: 8px; }
.btn-icon {
    width: 38px; height: 38px; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg3); border: 1px solid var(--border); border-radius: 10px;
    color: var(--text2); font-size: 15px; cursor: pointer;
    transition: border-color .18s, color .18s, background .18s;
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--bg3)); }
.copy-mini { padding: 5px 9px; font-size: 11px; min-width: 30px; }

/* ---------- Forms ---------- */
.input-txt, textarea, select, .mini-input {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 14px;
    font-family: inherit; font-size: 13px;
    color: var(--text);
    outline: none;
    margin-bottom: 12px;
    transition: border-color .18s, box-shadow .18s;
    appearance: none;
    -webkit-appearance: none;
}
.input-txt:focus, textarea:focus, select:focus, .mini-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
textarea { min-height: 150px; resize: vertical; line-height: 1.6; }
textarea.dragover { border-color: var(--accent-gold); background: color-mix(in srgb, var(--accent-gold) 7%, var(--bg3)); }
select { background-image: linear-gradient(45deg, transparent 50%, var(--text2) 50%), linear-gradient(135deg, var(--text2) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; cursor: pointer; }
select option { background: var(--bg2); color: var(--text); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

/* ---------- Sidebar navigation ---------- */
.nav-bar { display: flex; gap: 10px; margin-top: 18px; padding-bottom: 4px; overflow-x: auto; }
.nav-head {
    display: none;
    font-size: 10px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase;
    color: var(--text2); opacity: .8;
    padding: 14px 12px 6px;
}
.nav-item {
    background: transparent; color: var(--text2);
    border: 1px solid transparent; border-radius: 10px;
    padding: 10px 15px;
    font-family: inherit; font-size: 13px; font-weight: 500;
    cursor: pointer; white-space: nowrap;
    transition: background .15s, color .15s, border-color .15s;
}
.nav-item:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.nav-item.active {
    color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
    font-weight: 600;
}
@media (min-width: 1025px) {
    #main-nav.nav-bar {
        position: fixed; left: 16px; top: 72px; bottom: 16px; width: 236px;
        display: none; flex-direction: column; align-items: stretch;
        padding: 10px 8px; gap: 2px;
        background: var(--bg2); border: 1px solid var(--border); border-radius: 16px;
        z-index: 90; overflow-y: auto;
        box-shadow: var(--shadow);
    }
    #main-nav .nav-head { display: block; }
    #main-nav .nav-item { text-align: left; width: 100%; padding: 9px 12px; display: flex; align-items: center; gap: 10px; }
    #main-nav .nav-item.active {
        background: color-mix(in srgb, var(--accent) 13%, transparent);
        color: var(--accent);
        box-shadow: inset 2px 0 0 var(--accent);
    }
    .shell { padding-left: 272px; }
}
@media (min-width: 1401px) {
    #main-nav.nav-bar { left: calc((100vw - 1560px + 40px) / 2); }
}
@media (max-width: 1024px) {
    #main-nav.nav-bar {
        position: sticky; top: 62px; z-index: 95;
        display: none; flex-direction: row; flex-wrap: nowrap;
        gap: 8px; margin: 8px 0 0;
        background: var(--bg2); border: 1px solid var(--border); border-radius: 12px;
        padding: 8px 10px; overflow-x: auto; align-items: center;
        -webkit-overflow-scrolling: touch;
    }
    #main-nav .nav-head { display: none; }
    #main-nav .nav-item { border: 1px solid var(--border); background: var(--bg3); flex: 0 0 auto; }
}
.page-crumb {
    display: none; margin: 14px 0 0;
    padding: 8px 14px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--bg2);
    font-size: 12px; color: var(--text2);
}
.page-crumb b { color: var(--accent); font-weight: 600; }

/* ---------- Cards ---------- */
.card {
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: 14px; padding: 20px 22px;
    position: relative;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.card-title {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase;
    color: var(--text2);
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px; margin-bottom: 16px;
}
.card-title span { display: inline-flex; align-items: center; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1.6fr; gap: 18px; align-items: start; }
.dash-card-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-top: 4px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }

/* ---------- Stat boxes ---------- */
.stat-box {
    background: var(--bg3); border: 1px solid var(--border);
    border-radius: 12px; padding: 16px 14px;
    text-align: left;
    position: relative; overflow: hidden;
}
.stat-box::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); opacity: .85; border-radius: 0 3px 3px 0; }
.stat-val { font-size: 24px; font-weight: 700; font-family: 'JetBrains Mono', monospace; letter-spacing: -.5px; line-height: 1.2; }
.stat-label { font-size: 10px; font-weight: 600; letter-spacing: 1.2px; color: var(--text2); margin-top: 5px; text-transform: uppercase; }

/* ---------- Profile / user ---------- */
.user-info { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 18px; background: var(--bg3); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 16px; }
.user-avatar { width: 46px; height: 46px; border-radius: 50%; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 700; background: linear-gradient(135deg, var(--accent2), var(--accent)); color: var(--btn-ink); }
.badge-pro { margin-left: auto; padding: 5px 12px; border-radius: 999px; font-size: 11px; font-weight: 600; background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent); }
.badge-pro.badge-vip { background: color-mix(in srgb, var(--accent-gold) 12%, transparent); border-color: color-mix(in srgb, var(--accent-gold) 45%, transparent); color: var(--accent-gold); }
.avatar-mini { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); margin-left: 10px; object-fit: cover; }

/* ---------- Rings / progress ---------- */
.ring-wrap { display: flex; align-items: center; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.progress-ring { width: 104px; height: 104px; transform: rotate(-90deg); }
.progress-ring circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.ring-bg { stroke: var(--border); }
.ring-fg { stroke: var(--accent); stroke-dasharray: 314; stroke-dashoffset: 314; transition: .4s; }
.ring-box { position: relative; width: 104px; height: 104px; }
.ring-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: 'JetBrains Mono', monospace; font-size: 18px; color: var(--text); font-weight: 700; }

/* ---------- Lists ---------- */
.result-list {
    font-family: 'JetBrains Mono', monospace; font-size: 12px;
    height: 260px; overflow-y: auto;
    background: var(--bg3); border: 1px solid var(--border);
    padding: 10px; border-radius: 12px;
    color: var(--text2);
}
.list-item {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    padding: 10px 13px;
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: 9px; margin-bottom: 7px;
    font-family: 'JetBrains Mono', monospace; font-size: 12px;
    transition: border-color .15s;
}
.list-item:hover { border-color: var(--text2); }

/* ---------- Console / chat ---------- */
.bot-console, pre.bot-console {
    background: #080c11; color: #7ee2a8;
    border: 1px solid var(--border); border-radius: 12px;
    padding: 14px 16px;
    font-family: 'JetBrains Mono', monospace; font-size: 12px;
    line-height: 1.65; white-space: pre-wrap;
    margin-top: 8px; overflow-x: auto;
}
[data-theme="light"] .bot-console, [data-theme="light"] pre.bot-console { background: #0c1116; }
.chat-container { display: flex; flex-direction: column; height: 400px; background: var(--bg3); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.chat-box { flex: 1; padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.chat-msg { max-width: 78%; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.55; }
.msg-user { background: var(--bg2); color: var(--text); align-self: flex-start; border: 1px solid var(--border); border-bottom-left-radius: 3px; }
.msg-admin { background: color-mix(in srgb, var(--accent) 13%, var(--bg2)); color: var(--accent); align-self: flex-end; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-bottom-right-radius: 3px; }
.chat-input-area { display: flex; gap: 8px; border-top: 1px solid var(--border); background: var(--bg2); padding: 10px; }

/* ---------- Tabs ---------- */
.tab-section { display: none; }
.tab-section.active { display: block; animation: tabIn .28s ease; }
@keyframes tabIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Public: landing / auth ---------- */
.landing { padding: 34px 0 10px; }
.landing-hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 20px; align-items: stretch; }
.hero-card { display: flex; flex-direction: column; justify-content: center; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 9%, var(--bg2)), var(--bg2) 46%); }
.hero-title { font-size: clamp(30px, 4vw, 44px); line-height: 1.08; font-weight: 800; letter-spacing: -1px; margin-bottom: 14px; }
.hero-title span { color: var(--accent); }
.hero-sub { color: var(--text2); font-size: 14.5px; line-height: 1.7; max-width: 620px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.feature-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 4px; }
.feature-card { background: var(--bg3); border: 1px solid var(--border); border-radius: 12px; padding: 14px 15px; font-size: 13px; color: var(--text2); line-height: 1.55; }
.feature-card b { color: var(--text); display: block; margin-bottom: 5px; font-size: 13.5px; }
.login-shell { padding: 44px 0; }
#auth-panel { max-width: 400px; margin: 0 auto; text-align: center; }
.auth-title { font-size: 26px; font-weight: 800; margin-bottom: 18px; letter-spacing: -.3px; }
.auth-title span { color: var(--accent); }
.auth-box {
    background: var(--bg2); border: 1px solid var(--border); border-radius: 16px;
    padding: 26px 26px 22px;
    box-shadow: var(--shadow-lg);
    text-align: left;
}
.auth-box input {
    width: 100%; background: var(--bg3); border: 1px solid var(--border);
    border-radius: 10px; padding: 12px 14px;
    font-family: 'JetBrains Mono', monospace; font-size: 13.5px; color: var(--text);
    outline: none; margin-bottom: 13px; text-align: center;
    transition: border-color .18s, box-shadow .18s;
}
.auth-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.auth-box .btn { width: 100%; height: 44px; margin-top: 4px; }
.auth-box .btn + .btn { margin-top: 9px; }

/* ---------- Modals ---------- */
.modal-overlay {
    position: fixed; inset: 0; z-index: 5000;
    background: color-mix(in srgb, #000 62%, transparent);
    display: none; align-items: center; justify-content: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 18px;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--bg2); border: 1px solid var(--border); border-radius: 16px;
    padding: 24px; max-width: 520px; width: 100%;
    max-height: 88vh; overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: tabIn .22s ease;
}
.modal h2 { font-size: 18px; font-weight: 700; color: var(--text); }
.modal-section { margin-bottom: 22px; }
.modal-section h3 { font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--text2); margin-bottom: 12px; }
.modal .modal-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }

/* ---------- Theme / language pickers ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; }
.theme-swatch {
    aspect-ratio: 1; border-radius: 10px; cursor: pointer;
    border: 2px solid transparent; transition: border-color .15s, transform .15s;
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 800; letter-spacing: 1px; text-align: center;
    box-shadow: var(--shadow);
}
.theme-swatch:hover { transform: scale(1.04); }
.theme-swatch.active { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.lang-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.lang-btn { padding: 11px 6px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg3); cursor: pointer; text-align: center; font-size: 12.5px; color: var(--text2); transition: .15s; }
.lang-btn:hover { border-color: var(--text2); color: var(--text); }
.lang-btn.active { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg3)); }

/* ---------- Toggles ---------- */
.toggle-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); gap: 14px; }
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 13px; color: var(--text); }
.toggle-switch {
    position: relative; width: 42px; height: 24px; flex: 0 0 auto;
    background: var(--bg3); border: 1px solid var(--border);
    border-radius: 999px; cursor: pointer; transition: background .2s, border-color .2s;
}
.toggle-switch::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--text2); transition: transform .2s, background .2s;
}
.toggle-switch.on { background: var(--accent); border-color: var(--accent); }
.toggle-switch.on::after { transform: translateX(18px); background: var(--btn-ink); }

/* ---------- Shortcuts / kbd ---------- */
.kbd { display: inline-block; padding: 2px 7px; border-radius: 6px; background: var(--bg3); border: 1px solid var(--border); border-bottom-width: 2px; font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text2); }
.shortcut-list { list-style: none; }
.shortcut-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; color: var(--text2); border-bottom: 1px solid var(--border); }
.shortcut-list li:last-child { border-bottom: none; }

/* ---------- Misc components ---------- */
.pro-grid { display: grid; grid-template-columns: 330px 1fr; gap: 16px; align-items: start; }
.pro-side { background: var(--bg3); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.pro-list { max-height: 560px; overflow: auto; font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text2); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); font-size: 10px; color: var(--text2); font-weight: 600; }
.mini-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.mini-input { flex: 1; min-width: 160px; margin-bottom: 0; font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.result-tabs { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; margin-bottom: 10px; }
.result-tab-item { display: flex; gap: 6px; min-width: 0; }
.result-tab-item .btn { flex: 1; min-width: 0; }
.checker-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.filter-btn { background: var(--bg3); border: 1px solid var(--border); color: var(--text2); padding: 6px 12px; font-size: 12px; border-radius: 8px; cursor: pointer; font-family: inherit; transition: .15s; }
.filter-btn.active { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 11%, var(--bg3)); font-weight: 600; }
.human-box { display: flex; gap: 8px; align-items: center; background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-bottom: 12px; }
.human-q { min-width: 120px; font-family: 'JetBrains Mono', monospace; color: var(--accent-gold); font-weight: 700; font-size: 13px; text-align: center; }
.human-input { flex: 1; margin: 0 !important; padding: 9px 12px !important; }
#maintenance-screen {
    display: none; position: fixed; inset: 0; z-index: 9999;
    background: var(--bg);
    flex-direction: column; align-items: center; justify-content: center; text-align: center;
    padding: 24px;
}
#maintenance-screen .maint-icon { font-size: 54px; margin-bottom: 18px; }
#maintenance-screen h1 { color: var(--accent-gold); font-size: 28px; font-weight: 800; letter-spacing: 1px; }
#maintenance-screen p { color: var(--text2); font-size: 14px; margin-top: 12px; line-height: 1.7; }
#toast-wrap { position: fixed; top: 68px; right: 16px; z-index: 9000; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 32px)); }
[dir="rtl"] #toast-wrap { right: auto; left: 16px; }
.toast {
    padding: 12px 16px; border-radius: 11px;
    font-size: 13px; font-weight: 500;
    background: var(--bg2); border: 1px solid var(--border);
    border-left: 3px solid var(--text2);
    box-shadow: var(--shadow-lg);
    animation: toastIn .25s ease;
}
@keyframes toastIn { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.success { border-left-color: var(--accent); color: var(--accent); }
.toast.error { border-left-color: var(--accent3); color: var(--accent3); }

/* ---------- Utility ---------- */
.on { /* legacy state marker */ }

/* ---------- Compact / high-contrast modes ---------- */
body.compact .card { padding: 15px 16px; }
body.compact textarea { min-height: 110px; }
body.compact .result-list { height: 210px; }
body.high-contrast { --border: #7c8a99; --text: #ffffff; --text2: #dde4ec; --bg: #000; --bg2: #0a0c0f; --bg3: #15181c; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .grid-2, .pro-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .dash-card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .theme-grid { grid-template-columns: repeat(3, 1fr); }
    .landing-hero { grid-template-columns: 1fr; }
    .landing { padding-top: 18px; }
    .shell { padding: 0 10px 48px; }
    header { margin: 0 -10px 4px; padding: 12px 14px; }
    .logo-icon { width: 36px; height: 36px; font-size: 15px; }
    .logo-text { font-size: 17px; }
    .header-right { width: 100%; justify-content: flex-start; order: 3; }
    .btn-icon { width: 40px; height: 40px; }
    #logout-btn { margin-left: auto; }
    .hero-title { font-size: 30px; }
    .feature-row { grid-template-columns: 1fr; }
    .checker-actions { flex-direction: column; }
    .checker-actions .btn, #check-btn { width: 100%; }
    .result-tabs { grid-template-columns: 1fr; }
    .result-tab-item { width: 100%; }
    .result-tab-item .btn { min-height: 46px; }
    .mini-toolbar { display: grid; grid-template-columns: 1fr 1fr; }
    .mini-toolbar .mini-input, .mini-toolbar .btn, .mini-toolbar select { width: 100%; min-width: 0; margin-bottom: 0; }
    #filter-box { flex-wrap: wrap; }
    #filter-box .filter-btn { flex: 1; min-width: 84px; }
    textarea { min-height: 130px; }
    .result-list { height: 320px; }
    .pro-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .dash-card-grid { grid-template-columns: 1fr 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .modal { padding: 18px; }
}


/* ============================================================
   WS CHECKER v6 — Mobile experience pass
   ============================================================ */
@media (max-width: 1024px) {
    /* sticky topbar that never collides with the nav strip */
    header { position: relative; }
    #main-nav.nav-bar { position: sticky; top: 0; z-index: 96; border-radius: 12px; }
    #main-nav .nav-item { min-height: 42px; }
    /* prevent iOS auto-zoom when focusing fields */
    .input-txt, textarea, select, .mini-input, .auth-box input, #cmd-input { font-size: 16px; }
    .btn { max-width: 100%; }
    .card { padding: 16px; }
    .grid-2, .pro-grid { grid-template-columns: 1fr; }
    .chat-input-area { flex-wrap: wrap; }
    .chat-input-area .input-txt { flex: 1 1 100%; }
    .chat-input-area .btn { width: auto; flex: 0 0 auto; }
    .result-tab-item .btn { min-height: 50px; }
}
@media (max-width: 700px) {
    .stat-val { font-size: 19px; }
    .dash-card-grid { gap: 10px; }
    .stat-box { padding: 13px 12px; }
    .stat-label { font-size: 9px; }
    .logo-text { font-size: 17px; }
    .logo-sub { letter-spacing: 1.6px; }
    .result-tab-item .btn { min-height: 54px; font-weight: 700; }
    .hero-card { padding: 22px; }
    .feature-card { font-size: 12.5px; }
    .modal { padding: 18px; }
    .user-info { padding: 14px; }
    .badge-pro { margin-left: 0; }
    .grid-2 { gap: 12px; }
    #notif-dropdown { right: 10px; width: calc(100vw - 20px); }
    .bot-console, pre.bot-console { font-size: 11px; padding: 12px; }
    .list-item { padding: 10px 11px; flex-wrap: wrap; }
    .mini-toolbar { grid-template-columns: 1fr; }
    .pro-side { padding: 12px; }
    /* long words / urls never push the page sideways */
    .card, .stat-box, .pro-side, .user-info { overflow-wrap: anywhere; min-width: 0; }
    .tab-section { padding-top: 12px; }
}
/* RTL safety for the fixed sidebar */
[dir="rtl"] .shell { padding-left: 20px; }
@media (min-width: 1025px) {
    [dir="rtl"] .shell { padding-left: 20px; padding-right: 272px; }
    [dir="rtl"] #main-nav.nav-bar { left: auto; right: 16px; }
}

@media (max-width: 700px) {
    /* never let inline flex rows overflow a phone screen */
    #app-container div[style*="display:flex"], .shell div[style*="display:flex"] { flex-wrap: wrap; }
    #app-container div[style*="display:flex"] > .input-txt,
    #app-container div[style*="display:flex"] > select { flex: 1 1 150px; }
    #sys-info-text { overflow-x: auto; }
}

/* ============================================================
   WS CHECKER v6 — Hamburger drawer navigation (web + app)
   Replaces the permanent sidebar / mobile tab strip: the nav now
   slides in from the left behind the menu button on every screen.
   ============================================================ */
.btn-menu-btn { font-size: 18px; line-height: 1; }
.logo { margin-left: 6px; }
#main-nav.nav-bar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: min(306px, 88vw);
    margin: 0;
    z-index: 700;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 14px 10px 26px;
    background: var(--bg2);
    border: 1px solid var(--border); border-left: none;
    border-radius: 0 18px 18px 0;
    box-shadow: none;
    transform: translateX(-106%);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: transform .28s ease, box-shadow .28s ease, opacity .2s ease, visibility 0s linear .24s;
    overflow-y: auto; overflow-x: hidden;
}
#main-nav.nav-bar.open {
    transform: translateX(0);
    opacity: 1; visibility: visible; pointer-events: auto;
    box-shadow: var(--shadow-lg);
    transition: transform .28s ease, box-shadow .28s ease, opacity .2s ease;
}
#nav-backdrop {
    position: fixed; inset: 0; z-index: 650;
    background: rgba(3, 7, 11, 0.55);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .2s ease, visibility 0s linear .24s;
}
#nav-backdrop.show { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .2s ease; }
body.nav-open { overflow: hidden; }

.nav-drawer-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 8px 14px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border);
}
.nav-drawer-brand .logo-icon { width: 34px; height: 34px; font-size: 15px; border-radius: 10px; }
.nav-drawer-title { flex: 1; min-width: 0; font-weight: 800; font-size: 14px; line-height: 1.2; }
.nav-drawer-title span { color: var(--accent); }
.nav-drawer-title small { display: block; font-size: 9px; letter-spacing: 1.6px; color: var(--text2); font-weight: 600; margin-top: 2px; }
.nav-drawer-brand .btn-icon { width: 32px; height: 32px; font-size: 12px; }

#main-nav .nav-head { display: block; padding: 14px 12px 5px; }
#main-nav .nav-item {
    text-align: left; width: 100%;
    padding: 11px 13px;
    display: flex; align-items: center; gap: 10px;
    font-size: 13.5px; font-weight: 500;
    border-radius: 9px;
    white-space: nowrap;
    border: none; background: transparent; flex: none;
}
#main-nav .nav-item:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
#main-nav .nav-item.active:hover { background: color-mix(in srgb, var(--accent) 13%, transparent); }
#main-nav .nav-item.active {
    background: color-mix(in srgb, var(--accent) 13%, transparent);
    color: var(--accent); font-weight: 600;
    box-shadow: none;
}

/* No persistent sidebar on wide screens either — content spans the shell */
@media (min-width: 1025px) {
    .shell { padding-left: 20px; }
    header { padding-left: 22px; padding-right: 22px; }
}
@media (max-width: 1024px) {
    header { position: sticky; top: 0; }
}
@media (max-width: 700px) {
    .logo-icon { width: 34px; height: 34px; }
    .btn-menu-btn { width: 40px; height: 40px; }
}
/* RTL: drawer slides in from the right */
[dir="rtl"] #main-nav.nav-bar {
    left: auto; right: 0;
    border-left: 1px solid var(--border); border-right: none;
    border-radius: 18px 0 0 18px;
    transform: translateX(106%);
}
[dir="rtl"] #main-nav.nav-bar.open { transform: translateX(0); }
[dir="rtl"] .shell { padding-left: 20px; padding-right: 20px; }

/* ---- WS CHECKER v6 — icon system & app logo ---- */
.ic{ width:16px;height:16px;flex:0 0 auto;display:inline-block;vertical-align:-0.13em; }
.btn .ic{ width:15px;height:15px; }
.btn-sm .ic,.btn.btn-sm .ic{ width:13px;height:13px; }
.btn-icon .ic{ width:16px;height:16px; }
.btn-icon.btn-sm .ic,.copy-mini .ic{ width:13px;height:13px; }
.card-title .ic{ width:15px;height:15px; }
.stat-label{ display:flex; align-items:center; gap:6px; }
.stat-label .ic{ width:13px;height:13px; }
.filter-btn{ display:inline-flex; align-items:center; justify-content:center; gap:6px; }
.filter-btn .ic{ width:13px;height:13px; }
.lang-btn{ display:inline-flex; align-items:center; justify-content:center; gap:7px; }
.lang-code{ font-size:9px; font-weight:800; letter-spacing:.6px; padding:2px 5px; border-radius:5px; background:color-mix(in srgb,var(--text) 10%,transparent); border:1px solid var(--border); color:var(--text2); font-family:'JetBrains Mono',monospace; line-height:1.5; }
.user-avatar .ic{ width:22px;height:22px; }
#maintenance-screen .maint-icon .ic{ width:52px;height:52px; }
.maint-icon{ line-height:0; }
.toast{ display:flex; align-items:center; gap:9px; }
.toast .ic{ width:15px;height:15px; }
.toast.success .ic{ color:var(--accent); }
.toast.error .ic{ color:var(--accent3); }
.nav-item .ic{ width:16px;height:16px; }
h3 .ic{ vertical-align:-0.16em; }
.logo-icon.logo-img{ background:transparent; box-shadow:none; color:transparent; font-size:0; }
.auth-logo{ width:62px; height:62px; border-radius:17px; display:block; margin:0 auto 16px; box-shadow:0 10px 28px rgba(0,0,0,.28); }
#btn-notif{ position:relative; }
#notif-badge{ position:absolute; top:-5px; right:-5px; min-width:15px; height:15px; padding:0 3px; border-radius:8px; background:var(--accent3); color:#fff; font-size:9px; font-weight:800; line-height:15px; text-align:center; }

.list-item .ic{ width:13px;height:13px; }
.copy-mini .ic{ margin:0; }
.auth-box{ text-align:center; }
