/* ================================================================
   GhostRust — TACTICAL OPS CENTER
   Aesthetic: Military command interface / hacker dashboard
   Palette: Void black × Blood red × Cold white
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;600;700;800&family=Barlow:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ---- Design tokens ---- */
:root {
    --void: #000000;
    --bg-primary: #030304;
    --bg-secondary: #07070a;
    --bg-card: #0c0c10;
    --bg-elevated: #111116;
    --bg-hover: #17171d;

    --border: #1f1f28;
    --border-subtle: #131318;
    --border-bright: #2e2e3a;

    --text-primary: #e6e6f0;
    --text-secondary: #6a6a88;
    --text-muted: #36364a;
    --text-dim: #1e1e28;

    --accent: #bf0000;
    --accent-hot: #ff1a1a;
    --accent-dim: #7a0000;
    --accent-glow: rgba(191, 0, 0, 0.55);
    --accent-glow-sm: rgba(191, 0, 0, 0.18);
    --accent-bg: rgba(191, 0, 0, 0.07);
    --accent-grad: linear-gradient(135deg, #bf0000 0%, #ff2a2a 100%);

    --green: #00bb77;
    --green-bright: #00ee99;
    --green-bg: rgba(0, 187, 119, 0.09);
    --green-glow: rgba(0, 187, 119, 0.4);
    --red: #ff2424;
    --red-bg: rgba(255, 36, 36, 0.09);
    --yellow: #ffaa00;
    --yellow-bg: rgba(255, 170, 0, 0.09);
    --blue: #3a7fff;
    --blue-bg: rgba(58, 127, 255, 0.09);

    --radius-xs: 2px;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;

    --font-display: 'Barlow Condensed', sans-serif;
    --font-body: 'Barlow', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --ease-sharp: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);

    --t-fast: 120ms;
    --t-med: 220ms;
    --t-slow: 380ms;

    --shadow-deep: 0 12px 60px rgba(0, 0, 0, 0.9);
    --shadow-red: 0 0 24px rgba(191, 0, 0, 0.35), 0 0 80px rgba(191, 0, 0, 0.10);
    --glow-red: 0 0 8px var(--accent-glow), 0 0 24px rgba(191, 0, 0, 0.18);
    --glow-green: 0 0 8px var(--green-glow), 0 0 24px rgba(0, 187, 119, 0.10);
}

/* ================================================================
   RESET & BASE
   ================================================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 400;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Tactical grid background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(rgba(191, 0, 0, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(191, 0, 0, 0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}

/* Corner decoration — top left */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 120px;
    height: 120px;
    background:
        linear-gradient(to right, rgba(191, 0, 0, 0.12) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(191, 0, 0, 0.12) 1px, transparent 1px);
    background-size: 12px 12px;
    z-index: 0;
    pointer-events: none;
    mask-image: radial-gradient(ellipse at top left, black 10%, transparent 70%);
}

.hidden {
    display: none !important;
}

/* ================================================================
   KEYFRAME ANIMATIONS
   ================================================================ */

/* Logo: subtle breathing glow — replaces the jarring glitch */
@keyframes logoBreath {

    0%,
    100% {
        text-shadow: 0 0 8px rgba(255, 26, 26, 0.2);
        opacity: 1;
    }

    50% {
        text-shadow: 0 0 18px rgba(255, 26, 26, 0.45), 0 0 40px rgba(191, 0, 0, 0.12);
        opacity: 0.92;
    }
}

/* Ghost icon slow float */
@keyframes ghostFloat {

    0%,
    100% {
        transform: translateY(0px);
        filter: drop-shadow(0 0 5px var(--accent-glow));
    }

    50% {
        transform: translateY(-2px);
        filter: drop-shadow(0 0 10px var(--accent-glow));
    }
}

/* Spinning loader */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Scanline sweep */
@keyframes scanline {
    0% {
        transform: translateY(-4px);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(100%);
        opacity: 0;
    }
}

/* Panel reveal on tab switch */
@keyframes panelReveal {
    from {
        opacity: 0;
        transform: translateX(10px);
        clip-path: inset(0 8% 0 0);
    }

    to {
        opacity: 1;
        transform: translateX(0);
        clip-path: inset(0 0% 0 0);
    }
}

/* Card stagger pop */
@keyframes staggerIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Badge pulse */
@keyframes badgePulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 var(--accent-glow);
    }

    50% {
        transform: scale(1.12);
        box-shadow: 0 0 0 6px rgba(191, 0, 0, 0);
    }
}

/* Status dot pulse */
@keyframes dotPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Green online glow */
@keyframes onlineGlow {

    0%,
    100% {
        box-shadow: var(--glow-green);
    }

    50% {
        box-shadow: 0 0 4px var(--green-glow);
    }
}

/* Red alert glow */
@keyframes alertGlow {

    0%,
    100% {
        box-shadow: var(--glow-red);
    }

    50% {
        box-shadow: 0 0 4px var(--accent-glow);
    }
}

/* Dropdown slide in */
@keyframes dropIn {
    from {
        opacity: 0;
        transform: translateY(-6px) scaleY(0.94);
    }

    to {
        opacity: 1;
        transform: translateY(0) scaleY(1);
    }
}

/* Modal entrance */
@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.94) translateY(12px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Ripple on click */
@keyframes ripple {
    to {
        transform: scale(6);
        opacity: 0;
    }
}

/* Chat message slide */
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading fade out */
@keyframes loaderFadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* Lang button press */
@keyframes langPress {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

/* Header accent line shimmer */
@keyframes headerShimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

/* ================================================================
   LOADING OVERLAY
   ================================================================ */
#loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s var(--ease-smooth), visibility 0.3s;
}

#loading-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, rgba(191, 0, 0, 0.07) 0%, transparent 70%);
    pointer-events: none;
}

#loading-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.loader-ring {
    display: inline-block;
    position: relative;
    width: 72px;
    height: 72px;
    margin-bottom: 24px;
}

.loader-ring div {
    box-sizing: border-box;
    position: absolute;
    width: 56px;
    height: 56px;
    margin: 8px;
    border: 2px solid transparent;
    border-top-color: var(--accent-hot);
    border-radius: 50%;
    animation: spin 1.1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    transform: translateZ(0); /* Force hardware acceleration */
}

.loader-ring div:nth-child(1) {
    animation-delay: -0.45s;
}

.loader-ring div:nth-child(2) {
    animation-delay: -0.30s;
}

.loader-ring div:nth-child(3) {
    animation-delay: -0.15s;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-text {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ================================================================
   ACTION MODAL
   ================================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-deep), var(--shadow-red);
    width: 460px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    animation: modalIn var(--t-slow) var(--ease-bounce);
    position: relative;
    overflow: hidden;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-grad);
    box-shadow: var(--glow-red);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-primary);
}

.modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--t-fast), background var(--t-fast);
}

.modal-close:hover {
    color: var(--accent-hot);
    background: var(--accent-bg);
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-body label {
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-body input:not([type="checkbox"]),
.modal-body select {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 13px;
    outline: none;
    width: 100%;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.modal-body input:not([type="checkbox"]):focus,
.modal-body select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow-sm);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

/* Custom Checkbox as a Toggle */
.custom-toggle {
    appearance: none;
    -webkit-appearance: none;
    width: 36px;
    height: 20px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    outline: none;
    border: 1px solid var(--border-subtle);
    transition: background 0.3s, border-color 0.3s;
}

.custom-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: transform 0.3s, background 0.3s;
}

.custom-toggle:checked {
    background: var(--accent-glow-sm);
    border-color: var(--accent);
}

.custom-toggle:checked::after {
    transform: translateX(16px);
    background: var(--accent);
}

.modal-btn {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    transition: all var(--t-med) var(--ease-sharp);
    position: relative;
    overflow: hidden;
}

.modal-btn.secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.modal-btn.secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-btn.primary {
    background: var(--accent-grad);
    color: white;
    box-shadow: var(--glow-red);
}

.modal-btn.primary:hover {
    filter: brightness(1.15);
    box-shadow: 0 0 16px var(--accent-glow), 0 0 40px rgba(191, 0, 0, 0.2);
    transform: translateY(-1px);
}

.modal-btn.primary:active {
    transform: translateY(0);
}

/* ================================================================
   APP LAYOUT
   ================================================================ */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* ================================================================
   HEADER
   ================================================================ */
#header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 54px;
    min-height: 54px;
    background: linear-gradient(180deg, rgba(10, 0, 0, 0.97) 0%, var(--bg-secondary) 100%);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
    position: relative;
    overflow: hidden;
}

/* Animated shimmer stripe on header bottom edge */
#header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(191, 0, 0, 0.0) 20%,
            rgba(255, 26, 26, 0.6) 50%,
            rgba(191, 0, 0, 0.0) 80%,
            transparent 100%);
    background-size: 200% auto;
    animation: headerShimmer 6s linear infinite;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}


/* ================================================================
   LOGO — Ghost skull + GhostRust wordmark
   ================================================================ */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
}

.logo-icon {
    animation: ghostFloat 4s ease-in-out infinite;
    flex-shrink: 0;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    /* Gentle breathing glow — no jarring glitch */
    animation: logoBreath 5s ease-in-out infinite;
}

.logo-text .accent {
    color: var(--accent-hot);
    text-shadow: 0 0 12px rgba(255, 26, 26, 0.5);
}

/* Server info */
.server-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 20px;
    border-left: 1px solid var(--border);
}

.server-name {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-pop {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    padding: 2px 8px;
    border-radius: 2px;
    letter-spacing: 1px;
}

/* Guild select */
.guild-select {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 6px 12px;
    outline: none;
    cursor: pointer;
    max-width: 200px;
    transition: border-color var(--t-fast);
}

.guild-select:focus {
    border-color: var(--accent);
}

/* Connection badge */
.connection-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 2px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.connection-badge.connected {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid rgba(0, 187, 119, 0.2);
    box-shadow: 0 0 12px rgba(0, 187, 119, 0.08);
}

.connection-badge.disconnected {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid rgba(255, 36, 36, 0.2);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: dotPulse 2s ease-in-out infinite;
}

/* ================================================================
   LANGUAGE SELECTOR
   ================================================================ */
.lang-selector {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2px;
    position: relative;
    overflow: hidden;
}

/* Subtle divider between lang buttons */
.lang-selector::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(191, 0, 0, 0.3), transparent);
    pointer-events: none;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: var(--radius-xs);
    transition: all var(--t-med) var(--ease-sharp);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.lang-btn .flag {
    width: 20px;
    height: 14px;
    border-radius: 2px;
    object-fit: cover;
    flex-shrink: 0;
}

.lang-btn .lang-code {
    font-size: 10px;
}

.lang-btn:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

.lang-btn.active {
    background: var(--accent-bg);
    color: var(--accent-hot);
    border: 1px solid rgba(191, 0, 0, 0.2);
    box-shadow: inset 0 0 8px rgba(191, 0, 0, 0.06);
}

.lang-btn.active .flag {
    filter: drop-shadow(0 0 3px rgba(255, 26, 26, 0.3));
}

/* Ripple inside lang btn */
.lang-btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(191, 0, 0, 0.2);
    width: 10px;
    height: 10px;
    pointer-events: none;
    transform: scale(0);
    opacity: 1;
    animation: ripple 400ms var(--ease-sharp) forwards;
}

/* ================================================================
   TAB NAVIGATION — with dropdowns
   ================================================================ */
#tab-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 16px;
    height: 44px;
    min-height: 44px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 50;
    overflow: visible;
}

/* Decorative bottom line on nav */
#tab-nav::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-bright) 30%, var(--border-bright) 70%, transparent);
    pointer-events: none;
}

.nav-sep {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 4px;
    flex-shrink: 0;
}

/* Tab buttons (shared) */
.tab-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    border-radius: var(--radius-sm);
    transition: color var(--t-fast), background var(--t-fast);
    overflow: hidden;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    right: 50%;
    height: 2px;
    background: var(--accent-hot);
    transition: left var(--t-med) var(--ease-sharp), right var(--t-med) var(--ease-sharp);
    box-shadow: var(--glow-red);
}

.tab-btn:hover::after {
    left: 8px;
    right: 8px;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.tab-btn.active {
    color: var(--accent-hot);
    background: var(--accent-bg);
}

.tab-btn.active::after {
    left: 0;
    right: 0;
}

.tab-btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(191, 0, 0, 0.25);
    width: 10px;
    height: 10px;
    pointer-events: none;
    transform: scale(0);
    opacity: 1;
    animation: ripple 500ms var(--ease-sharp) forwards;
}

.badge {
    background: var(--accent-grad);
    color: white;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 2px;
    min-width: 18px;
    text-align: center;
    line-height: 16px;
    box-shadow: var(--glow-red);
    animation: badgePulse 2s ease-in-out infinite;
}

/* ---- Dropdown wrapper ---- */
.tab-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.dd-caret {
    width: 12px;
    height: 12px;
    transition: transform var(--t-med) var(--ease-sharp);
    flex-shrink: 0;
    opacity: 0.6;
}

.tab-dropdown.open .dd-caret {
    transform: rotate(180deg);
}

.tab-dropdown.has-active>.dropdown-trigger {
    color: var(--accent-hot);
    background: var(--accent-bg);
}

.tab-dropdown.has-active>.dropdown-trigger::after {
    left: 0;
    right: 0;
}

.dropdown-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-deep), 0 0 20px rgba(0, 0, 0, 0.5);
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 2px;
    z-index: 200;
    transform-origin: top left;
    animation: dropIn var(--t-med) var(--ease-bounce);
    overflow: hidden;
}

.dropdown-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--accent-grad);
}

/* Corner bracket decoration on dropdown */
.dropdown-panel::after {
    content: '';
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    border-bottom: 1px solid var(--accent-dim);
    border-right: 1px solid var(--accent-dim);
    pointer-events: none;
}

.tab-dropdown.open .dropdown-panel {
    display: flex;
}

.dd-item {
    width: 100%;
    text-align: left;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    justify-content: flex-start;
}

.dd-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 4px 10px 2px;
    display: block;
}

/* ================================================================
   MAIN CONTENT AREA
   ================================================================ */
#main-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.tab-panel {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.tab-panel.hidden {
    display: none !important;
}

.tab-panel:not(.hidden) {
    animation: panelReveal var(--t-slow) var(--ease-sharp) both;
}

/* ================================================================
   MAP TAB
   ================================================================ */
#tab-map {
    display: flex;
}

.map-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #020204;
    cursor: grab;
}

.map-container:active {
    cursor: grabbing;
}

/* Scanline overlay */
.map-container::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -4px;
    height: 3px;
    background: linear-gradient(180deg, transparent 0%, rgba(191, 0, 0, 0.18) 50%, transparent 100%);
    pointer-events: none;
    z-index: 5;
    animation: scanline 6s linear infinite;
}

/* Corner bracket decorations on map */
.map-container::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    width: 20px;
    height: 20px;
    border-top: 1px solid rgba(191, 0, 0, 0.4);
    border-left: 1px solid rgba(191, 0, 0, 0.4);
    pointer-events: none;
    z-index: 10;
}

#map-canvas {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
}

.map-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.map-tooltip {
    position: absolute;
    z-index: 20;
    padding: 6px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-primary);
    pointer-events: none;
    white-space: nowrap;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-deep), 0 0 10px var(--accent-glow-sm);
}

/* Player markers */
.player-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: all;
    z-index: 15;
    cursor: pointer;
    transition: left 1s linear, top 1s linear;
}

.player-marker-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    background-size: cover;
    background-position: center;
}

.player-marker-dot.online {
    background: var(--green-bright);
    animation: onlineGlow 2.5s ease-in-out infinite;
}

.player-marker-dot.offline {
    background: var(--text-muted);
    opacity: 0.5;
}

.player-marker-name {
    position: absolute;
    top: -26px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9), 0 0 8px rgba(0, 0, 0, 0.6);
}

/* Map Notes */
.map-note-pin {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(0,0,0,0.8);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    position: relative;
    box-shadow: inset 0 0 4px rgba(255,255,255,0.4), 2px 2px 4px rgba(0,0,0,0.5);
}

.map-note-pin::after {
    content: '';
    width: 8px;
    height: 8px;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.map-note-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    color: white;
    font-size: 11px;
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
    z-index: 2;
}

/* Shop markers */
.shop-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: all;
    z-index: 14; /* Just below player markers */
    cursor: pointer;
    transition: transform 0.1s ease-out;
}

.shop-marker img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.3);
}

.shop-marker:hover {
    z-index: 20;
}

.shop-marker:hover img {
    transform: scale(1.3);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}

/* ================================================================
   TEAM SIDEBAR
   ================================================================ */
.team-sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Decorative top-right bracket on sidebar */
.team-sidebar::before {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 14px;
    height: 14px;
    border-top: 1px solid var(--accent-dim);
    border-right: 1px solid var(--accent-dim);
    pointer-events: none;
    z-index: 1;
}

.sidebar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px 10px;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
}

.team-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.team-list::-webkit-scrollbar {
    width: 3px;
}

.team-list::-webkit-scrollbar-track {
    background: transparent;
}

.team-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.team-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    transition: background var(--t-fast);
    cursor: default;
    position: relative;
}

.team-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 2px;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
    transform: scaleY(0);
    transition: transform var(--t-med) var(--ease-bounce);
    box-shadow: var(--glow-red);
}

.team-card:hover {
    background: var(--bg-hover);
}

.team-card:hover::before {
    transform: scaleY(1);
}

.team-avatar-container {
    position: relative;
    flex-shrink: 0;
}

.team-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 800;
    color: var(--accent);
    overflow: hidden;
    background-position: center;
}

.team-avatar-status {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
    z-index: 2;
}

.team-avatar-status.online {
    background: var(--green);
    box-shadow: var(--glow-green);
}

.team-avatar-status.offline {
    background: var(--text-muted);
}

.team-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.team-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-location {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
    letter-spacing: 0.3px;
}

.team-steamid {
    font-family: var(--font-mono);
    font-size: 9px;
    color: rgba(255, 255, 255, 0.25);
    margin-top: 2px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.team-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.team-status-tag {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.steam-profile-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #c7d5e0;
    background: linear-gradient(to right, #1b2838, #2a475e);
    border: 1px solid #171a21;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 9px;
    font-weight: 700;
    font-family: Arial, sans-serif;
    text-decoration: none;
    transition: all 0.2s ease;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.steam-profile-btn:hover {
    color: #ffffff;
    background: linear-gradient(to right, #2a475e, #66c0f4);
    border-color: #66c0f4;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

.team-status-tag.online {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid rgba(0, 187, 119, 0.2);
}

.team-status-tag.offline {
    background: rgba(54, 54, 74, 0.15);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}

.team-status-tag.dead {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid rgba(255, 36, 36, 0.2);
    animation: alertGlow 2s ease-in-out infinite;
}

/* ================================================================
   CHAT TAB
   ================================================================ */
.chat-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.chat-msg {
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: background var(--t-fast);
    animation: fadeSlideIn var(--t-med) var(--ease-sharp);
    border-left: 2px solid transparent;
}

.chat-msg:hover {
    background: var(--bg-elevated);
    border-left-color: var(--border);
}

.chat-msg-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 2px;
}

.chat-msg-name {
    font-weight: 700;
    font-size: 13px;
}

.chat-msg-time {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.chat-msg-body {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    word-break: break-word;
}

.chat-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.chat-input-bar {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
}

.chat-input {
    flex: 1;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 9px 14px;
    outline: none;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.chat-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow-sm);
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-input:disabled {
    opacity: 0.4;
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--accent-grad);
    color: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--t-med) var(--ease-sharp);
    flex-shrink: 0;
    box-shadow: var(--glow-red);
    position: relative;
    overflow: hidden;
}

.chat-send-btn:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px var(--accent-glow);
}

.chat-send-btn:active {
    transform: translateY(0);
}

/* ================================================================
   EVENTS TAB
   ================================================================ */
.events-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.events-filter {
    display: flex;
    gap: 4px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}

.filter-btn {
    padding: 5px 14px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 2px;
    cursor: pointer;
    transition: all var(--t-med) var(--ease-sharp);
}

.filter-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-bright);
}

.filter-btn.active {
    background: var(--accent-bg);
    border-color: var(--accent);
    color: var(--accent-hot);
    box-shadow: var(--glow-red);
}

.events-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 20px;
}

.events-list::-webkit-scrollbar {
    width: 4px;
}

.events-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.event-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
    animation: fadeSlideIn var(--t-med) var(--ease-sharp);
    transition: background var(--t-fast);
}

.event-item:hover {
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    padding-left: 8px;
    margin: 0 -8px;
}

.event-item:last-child {
    border-bottom: none;
}

.event-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 15px;
    margin-top: 2px;
}

.event-icon.cargo {
    background: rgba(58, 127, 255, 0.12);
    color: rgb(58, 127, 255);
}

.event-icon.heli {
    background: rgba(255, 36, 36, 0.12);
    color: rgb(255, 36, 36);
}

.event-icon.chinook {
    background: rgba(255, 170, 0, 0.12);
    color: rgb(255, 170, 0);
}

.event-icon.small {
    background: rgba(0, 187, 119, 0.12);
    color: rgb(0, 187, 119);
}

.event-icon.large {
    background: rgba(191, 0, 0, 0.12);
    color: rgb(255, 50, 50);
}

.event-icon.default {
    background: var(--bg-elevated);
    color: var(--text-secondary);
}

.event-body {
    flex: 1;
    min-width: 0;
}

.event-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.4;
}

.event-time {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
    letter-spacing: 0.5px;
}

.events-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ================================================================
   SERVERS TAB
   ================================================================ */
.servers-container {
    height: 100%;
    overflow-y: auto;
    padding: 20px 24px;
}

.servers-container::-webkit-scrollbar {
    width: 4px;
}

.servers-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.section-header {
    margin-bottom: 16px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    margin-left: 28px;
    font-family: var(--font-mono);
    letter-spacing: 0.3px;
}

.server-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.server-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: all var(--t-slow) var(--ease-smooth);
    animation: staggerIn var(--t-slow) var(--ease-sharp) both;
    position: relative;
    overflow: hidden;
}

.server-card::before,
.server-card::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    transition: width var(--t-med), height var(--t-med);
}

.server-card::before {
    top: 6px;
    left: 6px;
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
}

.server-card::after {
    bottom: 6px;
    right: 6px;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

.server-card:hover::before,
.server-card:hover::after {
    width: 18px;
    height: 18px;
}

.server-card:hover::before {
    border-color: var(--accent-dim);
}

.server-card:hover::after {
    border-color: var(--accent-dim);
}

.server-card:hover {
    border-color: var(--border);
    background: var(--bg-elevated);
    transform: translateY(-2px);
    box-shadow: var(--shadow-deep);
}

.server-card.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), var(--shadow-red);
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(191, 0, 0, 0.04) 0%, var(--bg-card) 100%);
}

.server-card.active::before,
.server-card.active::after {
    border-color: var(--accent);
    width: 18px;
    height: 18px;
}

.server-card-img {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
}

.server-card-info {
    flex: 1;
    min-width: 0;
}

.server-card-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-card-ip {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 0.3px;
}

.server-card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.server-card.active .server-card-desc {
    -webkit-line-clamp: unset;
    line-clamp: unset;
    display: block;
}

.server-card-badge {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--green-bg);
    color: var(--green);
    align-self: flex-start;
    border: 1px solid rgba(0, 187, 119, 0.2);
    flex-shrink: 0;
}

.server-card-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.server-connect-btn {
    padding: 6px 14px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all var(--t-med) var(--ease-sharp);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.server-connect-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-bright);
    background: var(--bg-hover);
}

.server-connect-btn.connect {
    border-color: rgba(0, 187, 119, 0.4);
    color: var(--green);
    background: var(--green-bg);
}

.server-connect-btn.connect:hover {
    background: rgba(0, 187, 119, 0.15);
    box-shadow: 0 0 12px rgba(0, 187, 119, 0.15);
    transform: translateY(-1px);
}

.server-connect-btn.disconnect {
    border-color: rgba(255, 36, 36, 0.3);
    color: var(--red);
    background: var(--red-bg);
}

.server-connect-btn.disconnect:hover {
    background: rgba(255, 36, 36, 0.15);
    box-shadow: 0 0 12px rgba(255, 36, 36, 0.15);
    transform: translateY(-1px);
}

.server-connect-btn.primary {
    background: var(--accent-grad);
    color: white;
    border: none;
    box-shadow: var(--glow-red);
}

.server-connect-btn.primary:hover {
    filter: brightness(1.15);
    box-shadow: 0 0 16px var(--accent-glow), 0 0 40px rgba(191, 0, 0, 0.2);
    transform: translateY(-1px);
}

.servers-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
    font-size: 13px;
    font-family: var(--font-mono);
    letter-spacing: 1px;
}

.servers-empty svg {
    margin-bottom: 12px;
    opacity: 0.2;
}

/* FCM Log */
.fcm-activity-log {
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-card);
}

.fcm-activity-log::-webkit-scrollbar {
    width: 3px;
}

.fcm-activity-log::-webkit-scrollbar-thumb {
    background: var(--border);
}

.fcm-log-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--border-subtle);
    animation: fadeSlideIn var(--t-med) var(--ease-sharp);
    transition: background var(--t-fast);
}

.fcm-log-item:hover {
    background: var(--bg-elevated);
}

.fcm-log-item:last-child {
    border-bottom: none;
}

.fcm-log-icon {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.fcm-log-icon.server {
    background: var(--blue-bg);
}

.fcm-log-icon.entity {
    background: var(--yellow-bg);
}

.fcm-log-text {
    font-size: 12px;
    color: var(--text-secondary);
    flex: 1;
}

.fcm-log-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.fcm-log-time {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.fcm-log-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 1px;
}

/* ================================================================
   GENERIC TABS (Devices, Switch Groups, Storage, Trackers, Activity)
   ================================================================ */
.view-container {
    height: 100%;
    overflow-y: auto;
    padding: 20px 24px;
}

.view-container::-webkit-scrollbar {
    width: 4px;
}

.view-container::-webkit-scrollbar-thumb {
    background: var(--border);
}

.generic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 12px;
}

.generic-card {
    background: linear-gradient(145deg, rgba(30, 32, 38, 0.9) 0%, rgba(20, 22, 26, 0.95) 100%);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.generic-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}

.generic-card:nth-child(1) {
    animation: staggerIn var(--t-slow) 0ms var(--ease-sharp) both;
}

.generic-card:nth-child(2) {
    animation: staggerIn var(--t-slow) 60ms var(--ease-sharp) both;
}

.generic-card:nth-child(3) {
    animation: staggerIn var(--t-slow) 120ms var(--ease-sharp) both;
}

.generic-card:nth-child(4) {
    animation: staggerIn var(--t-slow) 180ms var(--ease-sharp) both;
}

.generic-card:nth-child(5) {
    animation: staggerIn var(--t-slow) 240ms var(--ease-sharp) both;
}

.generic-card:nth-child(6) {
    animation: staggerIn var(--t-slow) 300ms var(--ease-sharp) both;
}

.generic-card:nth-child(n+7) {
    animation: staggerIn var(--t-slow) 360ms var(--ease-sharp) both;
}

.generic-card::before,
.generic-card::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    transition: all var(--t-med) var(--ease-sharp);
}

.generic-card::before {
    top: 5px;
    left: 5px;
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
}

.generic-card::after {
    bottom: 5px;
    right: 5px;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

.generic-card:hover::before {
    width: 16px;
    height: 16px;
    border-color: var(--accent-dim);
}

.generic-card:hover::after {
    width: 16px;
    height: 16px;
    border-color: var(--accent-dim);
}

.generic-card:hover {
    border-color: var(--border);
    background: var(--bg-elevated);
    transform: translateY(-2px);
    box-shadow: var(--shadow-deep);
}

.generic-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.generic-card-title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-primary);
}

.generic-card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: auto;
}

/* Activity */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 16px;
}

.activity-item {
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-left: 2px solid var(--border);
    font-size: 12px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    letter-spacing: 0.2px;
    transition: all var(--t-fast);
    animation: staggerIn var(--t-slow) var(--ease-sharp) both;
}

.activity-item:hover {
    background: var(--bg-elevated);
    border-left-color: var(--accent);
    color: var(--text-primary);
}

.activity-item.fade-out {
    animation: slideUpFadeOut 0.4s var(--ease-spring) forwards;
}

@keyframes slideUpFadeOut {
    0% { opacity: 1; transform: scale(1); max-height: 120px; margin-bottom: 8px; }
    40% { opacity: 0; transform: scale(0.9); max-height: 120px; margin-bottom: 8px; }
    100% { opacity: 0; transform: scale(0.9); max-height: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; border-width: 0; overflow: hidden; }
}

@keyframes slideDownFadeIn {
    0% { opacity: 0; transform: scale(0.9); max-height: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; border-width: 0; overflow: hidden; }
    60% { opacity: 0; transform: scale(0.9); max-height: 120px; margin-bottom: 8px; }
    100% { opacity: 1; transform: scale(1); max-height: 120px; margin-bottom: 8px; }
}

.fade-out {
    animation: slideUpFadeOut 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards !important;
    pointer-events: none;
}

.fade-in-restore {
    animation: slideDownFadeIn 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards !important;
}

@keyframes shrinkWidth {
    from { width: 100%; }
    to { width: 0%; }
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: var(--accent);
    animation: shrinkWidth 5s linear forwards;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.activity-delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
    padding: 4px;
}

.activity-item:hover .activity-delete-btn {
    opacity: 1;
}

.activity-delete-btn:hover {
    color: var(--red);
}

/* ================================================================
   CREDENTIALS TAB
   ================================================================ */
.credentials-container {
    height: 100%;
    overflow-y: auto;
    padding: 20px 24px;
}

.credentials-container::-webkit-scrollbar {
    width: 4px;
}

.credentials-container::-webkit-scrollbar-thumb {
    background: var(--border);
}

.credentials-container code {
    background: var(--bg-elevated);
    padding: 1px 6px;
    border-radius: 2px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-hot);
}

.cred-form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.cred-form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--accent-grad);
}

/* Corner bracket on cred card */
.cred-form-card::after {
    content: '';
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 12px;
    height: 12px;
    border-bottom: 1px solid var(--accent-dim);
    border-right: 1px solid var(--accent-dim);
    pointer-events: none;
}

.cred-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.cred-textarea {
    width: 100%;
    min-height: 80px;
    max-height: 200px;
    resize: vertical;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.6;
    padding: 12px 14px;
    outline: none;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.cred-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow-sm);
}

.cred-textarea::placeholder {
    color: var(--text-muted);
    font-size: 11px;
}

.cred-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    gap: 12px;
}

.cred-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
}

.cred-checkbox-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--accent);
    cursor: pointer;
}

.cred-submit-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: none;
    background: var(--accent-grad);
    color: white;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--t-med) var(--ease-sharp);
    box-shadow: var(--glow-red);
    position: relative;
    overflow: hidden;
}

.cred-submit-btn:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.cred-submit-btn:active {
    transform: translateY(0);
}

.cred-submit-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

.cred-result {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.3px;
}

.cred-result.success {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid rgba(0, 187, 119, 0.2);
}

.cred-result.error {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid rgba(255, 36, 36, 0.2);
}

.cred-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cred-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 8px;
    transition: all var(--t-fast) var(--ease-sharp);
    user-select: none;
}

.cred-card:hover {
    background: var(--bg-elevated);
    border-color: var(--border);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.cred-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cred-card-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.cred-card-info {
    display: flex;
    flex-direction: column;
}

.cred-card-steamid {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    user-select: text;
}

.cred-card-meta {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
    letter-spacing: 0.3px;
}

.cred-card-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cred-card-badge {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.cred-card-badge.hoster {
    background: var(--accent-bg);
    color: var(--accent-hot);
    border: 1px solid rgba(191, 0, 0, 0.25);
}

.cred-card-badge.member {
    background: var(--blue-bg);
    color: var(--blue);
    border: 1px solid rgba(58, 127, 255, 0.2);
}

.cred-remove-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--t-fast);
}

.cred-remove-btn:hover {
    background: var(--red-bg);
    color: var(--red);
    box-shadow: 0 0 10px rgba(255, 36, 36, 0.15);
}

.cred-list-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* ================================================================
   SCROLLBARS (global)
   ================================================================ */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-bright);
}

/* ================================================================
   SERVER INFO (SIDEBAR)
   ================================================================ */
.sidebar-server-info {
    padding: 12px;
    background: rgba(0, 0, 0, 0.15);
}

.server-info-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.server-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: border-color 0.2s, background 0.2s;
}

.server-info-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-subtle);
}

.server-info-label {
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
}

.server-info-value {
    color: var(--text);
    font-weight: 500;
}

.server-info-value.highlight {
    color: var(--accent);
    text-shadow: 0 0 8px rgba(58, 134, 255, 0.3);
}

/* ==========================================================================
   Map Controls (Layers Panel)
   ========================================================================== */

.map-settings-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    left: auto;
    width: 44px;
    height: 44px;
    background: rgba(15, 17, 26, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.map-settings-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.map-settings-btn.active {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.1);
}

/* === Panel backdrop blocker === */
.map-panel-backdrop {
    position: absolute;
    inset: 0;
    z-index: 90;
    background: transparent;
    cursor: pointer;
    display: none;
}
.map-panel-backdrop.visible {
    display: block;
}

.map-settings-panel {
    position: absolute;
    top: 74px;
    right: 20px;
    left: auto;
    width: 290px;
    background: rgba(10, 12, 20, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 0;
    z-index: 100;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 20px 60px rgba(0, 0, 0, 0.7),
        0 0 40px rgba(58, 134, 255, 0.08);
    display: flex;
    flex-direction: column;
    transform-origin: top right;
    transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.1), visibility 0.25s ease;
    overflow: hidden;
}

.map-settings-panel.hidden {
    display: flex !important; /* Override inline hidden */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    pointer-events: none;
}

/* Panel header */
.map-settings-header {
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 100%);
}

.map-settings-header-icon {
    width: 28px;
    height: 28px;
    background: rgba(58, 134, 255, 0.15);
    border: 1px solid rgba(58, 134, 255, 0.3);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.map-settings-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Panel body scroll area */
.map-settings-body {
    padding: 8px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 72vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.map-settings-body::-webkit-scrollbar { width: 3px; }
.map-settings-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 4px;
}

/* Section dividers */
.map-settings-section-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 700;
    padding: 16px 8px 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.map-settings-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent);
    min-width: 20px;
}

/* Each toggle row */
.map-toggle-row {
    display: flex;
    align-items: center;
    gap: 0;
    cursor: pointer;
    user-select: none;
    padding: 10px 12px;
    border-radius: 10px;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.map-toggle-row:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(2px);
}

.map-toggle-row input[type="checkbox"] {
    display: none !important;
}

/* Classic square checkbox with premium animation */
.custom-checkbox {
    width: 18px;
    min-width: 18px;
    height: 18px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-right: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-toggle-row:hover .custom-checkbox {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.08);
}

.map-toggle-row input[type="checkbox"]:checked + .custom-checkbox {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

/* White checkmark tick */
.custom-checkbox::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-bottom: 3px;
}

.map-toggle-row input[type="checkbox"]:checked + .custom-checkbox::after {
    transform: rotate(45deg) scale(1);
    opacity: 1;
}

/* Toggle label with icon */
.toggle-label {
    flex: 1;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.83rem;
    font-weight: 500;
    transition: color 0.15s ease;
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.toggle-label-icon {
    font-size: 0.95rem;
    line-height: 1;
    flex-shrink: 0;
}

.map-toggle-row:hover .toggle-label {
    color: rgba(255, 255, 255, 0.85);
}

.map-toggle-row input[type="checkbox"]:checked ~ .toggle-label {
    color: rgba(255, 255, 255, 0.95);
}

/* Trails sub-group */
.map-toggle-group {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.2);
    overflow: hidden;
    margin: 6px 0;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.1);
}

.trail-slider-container {
    padding: 0px 14px 16px 42px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.trail-slider-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

.trail-slider-label #trail-duration-val {
    color: var(--accent-primary);
    font-weight: 800;
    font-size: 0.9rem;
    text-shadow: 0 0 10px rgba(58, 134, 255, 0.4);
}

/* Premium Slider */
.custom-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

/* The filled part of the slider (hack using box-shadow on thumb) */
.custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: 4px solid var(--accent-primary);
    box-shadow: -400px 0 0 390px var(--accent-primary), 0 0 10px rgba(0,0,0,0.5);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-top: -6px; /* Align with track */
}

.custom-slider::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 6px;
    background: transparent; /* Background handled by input itself */
}

.custom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.custom-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: 4px solid var(--accent-primary);
    box-shadow: -400px 0 0 390px var(--accent-primary), 0 0 10px rgba(0,0,0,0.5);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-slider::-moz-range-track {
    height: 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 900px) {
    .team-sidebar {
        display: none;
    }

    .server-info {
        display: none;
    }

    #tab-nav {
        padding: 0 8px;
        gap: 1px;
    }

    .tab-btn span:not(.badge) {
        display: none;
    }

    .tab-btn {
        padding: 8px 12px;
    }

    .server-list-grid {
        grid-template-columns: 1fr;
    }

    .cred-form-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .lang-btn .lang-code {
        display: none;
    }

    .lang-btn {
        padding: 4px 6px;
    }
}

/* =========================================
   SHOPS BROWSER MODAL
========================================= */
.shops-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.5s;
    visibility: hidden;
}

.shops-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.shops-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -40%) scale(0.9);
    width: 90%;
    max-width: 1000px;
    height: 80vh;
    background: rgba(18, 18, 22, 0.95);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(220, 53, 69, 0.2);
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.5s;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
}

.shops-modal.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.shops-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.shops-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.shops-modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 4px;
    display: flex;
}

.shops-modal-close:hover {
    color: #f44336;
}

.shop-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
}

.shop-search-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.shop-search-input:focus {
    border-color: #dc3545;
    outline: none;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

.shop-toggles {
    display: flex;
    gap: 20px;
    align-items: center;
}

/* Premium Toggles */
.premium-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
}

.premium-toggle {
    appearance: none;
    -webkit-appearance: none;
    width: 40px;
    height: 22px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    outline: none;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.premium-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.premium-toggle:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.premium-toggle:checked::after {
    transform: translateX(18px);
}

.shop-stats {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-left: auto;
}

.shop-stats span {
    color: #dc3545;
    font-weight: 600;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-rows: max-content;
    gap: 20px;
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.shop-card {
    background: rgba(15, 15, 18, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    height: max-content;
    min-height: fit-content;
}

.shop-card:hover {
    border-color: rgba(220, 53, 69, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(220, 53, 69, 0.1);
}

.shop-header {
    padding: 14px 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shop-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shop-grid-pos {
    font-size: 0.8rem;
    color: #dc3545;
    background: rgba(220, 53, 69, 0.15);
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.shop-items {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.shop-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    font-size: 0.85rem;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.shop-item-row:hover {
    border-color: rgba(220, 53, 69, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

.shop-item-row.out-of-stock {
    opacity: 0.5;
    background: rgba(244, 67, 54, 0.05);
    filter: grayscale(0.5);
}

.shop-item-name {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.shop-item-quantity {
    color: #dc3545;
    font-weight: 700;
    background: rgba(220, 53, 69, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.shop-item-stock-count {
    color: #4caf50;
    font-size: 0.8rem;
    font-weight: 600;
}

.shop-item-cost {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
}

.shop-item-cost span {
    color: #f1c40f;
    font-weight: 700;
}

.shop-out-of-stock-badge {
    color: #f44336;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(244, 67, 54, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.shop-no-items {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 20px;
    font-size: 0.95rem;
}

/* ── Tooltip icon for shop filters ── */
.shop-tooltip-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    cursor: help;
    margin-left: 6px;
    flex-shrink: 0;
    line-height: 1;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.shop-tooltip-icon:hover {
    background: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.5);
    color: #dc3545;
}

.shop-tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    border: 1px solid rgba(205, 127, 50, 0.4);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    font-weight: 400;
    font-style: normal;
    padding: 8px 12px;
    border-radius: 8px;
    width: 240px;
    text-align: left;
    line-height: 1.5;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 9999;
    white-space: normal;
}

.shop-tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(220, 53, 69, 0.4);
}

.shop-tooltip-icon:hover .shop-tooltip-text {
    visibility: visible;
    opacity: 1;
}/* --- Premium Statistics Panel --- */
.statistics-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    height: 85vh;
    background: linear-gradient(145deg, rgba(20, 20, 24, 0.95) 0%, rgba(10, 10, 12, 0.98) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: statsFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes statsFadeIn {
    0% { opacity: 0; transform: translate(-50%, -45%) scale(0.96); filter: blur(5px); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: blur(0); }
}

.statistics-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.statistics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 2;
}

.statistics-header h2 {
    margin: 0;
    font-size: 26px;
    color: #fff;
    font-family: 'Barlow Condensed', sans-serif;
    letter-spacing: 1.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.statistics-tabs {
    display: flex;
    gap: 16px;
    padding: 0 32px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    overflow-x: auto;
    scrollbar-width: none;
}

.tab-button {
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    border: none;
    padding: 20px 4px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.tab-button::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--rust-primary);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 3px 3px 0 0;
    box-shadow: 0 -2px 10px rgba(206, 66, 43, 0.5);
}

.tab-button:hover {
    color: #fff;
}

.tab-button:hover::after {
    transform: scaleX(0.5);
    background: rgba(206, 66, 43, 0.5);
}

.tab-button.active {
    color: #fff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.tab-button.active::after {
    transform: scaleX(1);
    background: var(--rust-primary);
}

.statistics-body {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    color: var(--text-primary);
    background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.02) 0%, transparent 70%);
    animation: fadeContent 0.4s ease-out;
}

@keyframes fadeContent {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.statistics-body::-webkit-scrollbar {
    width: 6px;
}
.statistics-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
.statistics-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.statistics-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Tablas Premium */
.statistics-body table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 20px;
}

.statistics-body th {
    background: rgba(255, 255, 255, 0.03);
    padding: 16px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.statistics-body td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: #eee;
    transition: background 0.2s;
}

.statistics-body tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.close-button {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.close-button:hover {
    background: rgba(229, 57, 53, 0.8);
    border-color: rgba(229, 57, 53, 1);
    box-shadow: 0 4px 15px rgba(229, 57, 53, 0.4);
    transform: translateY(-1px);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -48%) scale(0.98); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* --- STATISTICS INNER COMPONENTS --- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.stat-card { background: linear-gradient(145deg, rgba(40,40,45,0.6) 0%, rgba(20,20,25,0.8) 100%); padding: 2.5rem 2rem; border-radius: 16px; text-align: center; border: 1px solid rgba(255,255,255,0.05); transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); position: relative; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, #ff4e50, #f9d423); opacity: 0; transition: opacity 0.4s ease; }
.stat-card:hover { transform: translateY(-8px); border-color: rgba(255,255,255,0.1); box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 20px rgba(255, 78, 80, 0.1); }
.stat-card:hover::before { opacity: 1; }
.stat-icon { font-size: 2.5rem; margin-bottom: 1rem; opacity: 0.9; transform: scale(1); transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.stat-card:hover .stat-icon { transform: scale(1.15) rotate(5deg); }
.stat-value { font-size: 3rem; font-weight: 800; background: linear-gradient(to right, #fff, #aaa); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 0.5rem; letter-spacing: -1px; }
.stat-label { color: rgba(255,255,255,0.5); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 2px; font-weight: 600; }
.chart-container { background: #1a1a1a; border-radius: 12px; padding: 1.5rem; margin-bottom: 2rem; border: 1px solid #333; }
.chart-container canvas { width: 100% !important; height: auto !important; }
.team-stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.team-member-card { background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%); border: 1px solid #333; border-radius: 8px; padding: 1rem; transition: all 0.3s ease; }
.team-member-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 5px 15px rgba(211, 47, 47, 0.15); }
.member-name { font-weight: bold; font-size: 1.1rem; margin-bottom: 0.75rem; color: var(--accent); }
.member-stats { display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.9rem; color: var(--text-secondary); }
.member-stats span { display: flex; align-items: center; gap: 0.5rem; }
.players-list { display: grid; gap: 1rem; }
.player-stat-card { background: var(--bg-tertiary); padding: 1.5rem; border-radius: 8px; border: 1px solid var(--border); }
.player-stat-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.player-avatar-small { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--accent); }
.player-avatar-large { width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--accent); }
.steam-id { font-size: 0.8rem; color: var(--text-secondary); }
.player-stat-details { display: flex; flex-direction: column; gap: 0.5rem; }
.stat-row { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid var(--bg-primary); }
.stat-row:last-child { border-bottom: none; }
.view-details-btn, .back-button, .primary-button { margin-top: 1rem; padding: 0.75rem 1.5rem; background: var(--accent); color: white; border: none; border-radius: 6px; cursor: pointer; font-size: 0.95rem; transition: all 0.2s; }
.view-details-btn:hover, .back-button:hover, .primary-button:hover { background: var(--accent-hover); transform: translateY(-2px); }
.back-button { background: var(--bg-tertiary); color: var(--text-primary); margin-bottom: 1rem; }
.back-button:hover { background: var(--border); }
.player-header { display: flex; align-items: center; gap: 1.5rem; padding: 1.5rem; background: var(--bg-tertiary); border-radius: 8px; margin-bottom: 2rem; }
.sessions-list, .deaths-list { display: flex; flex-direction: column; gap: 0.75rem; max-height: 400px; overflow-y: auto; }
.session-item, .death-item { background: var(--bg-tertiary); padding: 1rem; border-radius: 6px; border-left: 3px solid var(--border); }
.session-item.active { border-left-color: var(--success); }
.session-time, .death-time { font-weight: bold; margin-bottom: 0.25rem; }
.session-duration, .death-location { color: var(--text-secondary); font-size: 0.9rem; }


/* --- STATISTICS TIMELINE COMPONENTS --- */
.time-range-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid #333; }
.time-range-controls h3 { margin: 0; padding: 0; border: none; }
.time-range-selector { display: flex; align-items: center; gap: 0.75rem; }
.time-range-selector label { color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; }
.time-range-selector select { padding: 0.6rem 1.2rem; background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid #333; border-radius: 6px; font-size: 0.9rem; cursor: pointer; transition: all 0.2s; }
.time-range-selector select:hover { border-color: var(--accent); }
.time-range-selector select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1); }
.timeline-legend { display: flex; gap: 1.5rem; margin-bottom: 1rem; padding: 0.75rem 1rem; background: var(--bg-tertiary); border-radius: 6px; border: 1px solid #333; }
.legend-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.replay-time-range { color: #aaa; font-size: 0.85rem; }
.replay-progress-container { margin-bottom: 1rem; }
.replay-progress-bar { width: 100%; height: 10px; -webkit-appearance: none; appearance: none; background: #333; border-radius: 5px; outline: none; cursor: pointer; }
.replay-progress-bar::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); cursor: pointer; }


/* --- STATISTICS CHAT COMPONENTS (redesigned) --- */
.stats-chat-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 0;
}

.stats-chat-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 16px 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    margin-bottom: 16px;
    flex-shrink: 0;
}

.stats-chat-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

.stats-chat-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-chat-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.06);
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.stats-chat-clear-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.25);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stats-chat-clear-btn:hover {
    background: rgba(244, 67, 54, 0.25);
    border-color: rgba(244, 67, 54, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.2);
}

.stats-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(85vh - 220px);
    padding-right: 4px;
}

.stats-chat-messages::-webkit-scrollbar {
    width: 4px;
}
.stats-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
}

.stats-chat-msg {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: chatMsgFadeIn 0.3s ease;
}

@keyframes chatMsgFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.stats-chat-user-link {
    flex-shrink: 0;
    display: block;
    text-decoration: none;
}

.stats-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #2a2a2a;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.08);
    transition: border-color 0.2s ease;
    display: block;
}

.stats-chat-user-link:hover .stats-chat-avatar {
    border-color: rgba(255, 87, 34, 0.5);
}

.stats-chat-bubble {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 10px 14px;
    min-width: 0;
    transition: background 0.2s ease;
}

.stats-chat-bubble:hover {
    background: rgba(255,255,255,0.06);
}

.stats-chat-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.stats-chat-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: #ff8a65;
    text-decoration: none;
    transition: color 0.2s;
}

.stats-chat-name:hover {
    color: #ff5722;
    text-decoration: underline;
}

.stats-chat-steamid {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.3);
    font-family: monospace;
    background: rgba(255,255,255,0.05);
    padding: 1px 6px;
    border-radius: 4px;
}

.stats-chat-timestamp {
    margin-left: auto;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.3);
    white-space: nowrap;
}

.stats-chat-text {
    color: rgba(255,255,255,0.85);
    font-size: 0.92rem;
    line-height: 1.5;
    word-break: break-word;
}

.stats-chat-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem 1rem;
    font-size: 0.95rem;
    opacity: 0.6;
}

/* Keep old selectors for backward compat */
.chat-avatar { width: 32px; height: 32px; border-radius: 50%; background: #333; }
.chat-time { margin-left: auto; color: var(--text-secondary); font-size: 0.8rem; }
.chat-text { color: var(--text-primary); line-height: 1.4; word-break: break-word; }


/* =========================================
   MAP REPLAY PAGE — Premium Redesign
   ========================================= */
.replay-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 700px;
}

/* --- Header --- */
.replay-page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.replay-page-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255,87,34,0.25) 0%, rgba(255,87,34,0.08) 100%);
    border: 1px solid rgba(255,87,34,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff5722;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(255,87,34,0.15);
}

.replay-page-title {
    margin: 0 0 4px 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
}

.replay-page-desc {
    margin: 0;
    font-size: 0.88rem;
    color: rgba(255,255,255,0.45);
    line-height: 1.5;
}

/* --- Config Card --- */
.replay-config-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.replay-config-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.replay-config-label svg {
    color: #ff5722;
    flex-shrink: 0;
}

/* --- Pill Buttons --- */
.replay-time-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.replay-time-pill {
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.55);
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
    font-family: inherit;
}

.replay-time-pill:hover {
    border-color: rgba(255,87,34,0.4);
    background: rgba(255,87,34,0.08);
    color: #ff8a65;
    transform: translateY(-1px);
}

.replay-time-pill.active {
    border-color: rgba(255,87,34,0.6);
    background: linear-gradient(135deg, rgba(255,87,34,0.2) 0%, rgba(255,87,34,0.1) 100%);
    color: #ff6d40;
    box-shadow: 0 0 0 1px rgba(255,87,34,0.15), 0 4px 12px rgba(255,87,34,0.2);
    transform: translateY(-1px);
}

/* --- Start Button --- */
.replay-start-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 28px;
    background: linear-gradient(135deg, #ff5722 0%, #e64a19 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: inherit;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 15px rgba(255,87,34,0.35);
    align-self: flex-start;
}

.replay-start-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 24px rgba(255,87,34,0.45);
    background: linear-gradient(135deg, #ff6d40 0%, #f4511e 100%);
}

.replay-start-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* --- How to Use Card --- */
.replay-howto-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 20px 24px;
}

.replay-howto-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.replay-howto-header svg {
    color: rgba(255,255,255,0.3);
    flex-shrink: 0;
}

.replay-howto-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.replay-howto-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.88rem;
    color: rgba(255,255,255,0.55);
    line-height: 1.5;
}

.replay-howto-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    background: rgba(255,87,34,0.12);
    border: 1px solid rgba(255,87,34,0.2);
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 800;
    color: #ff6d40;
    flex-shrink: 0;
    margin-top: 1px;
}
/* Replay Controls Overlay */
.replay-controls-overlay {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: auto;
}

.replay-control-bar {
    background: rgba(0, 0, 0, 0.92);
    border: 2px solid var(--accent);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    min-width: 800px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.replay-time-info {
    margin-bottom: 0.75rem;
    text-align: center;
}

.replay-current-time {
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.replay-time-range {
    color: #aaa;
    font-size: 0.85rem;
}

.replay-progress-container {
    margin-bottom: 1rem;
}

.replay-progress-bar {
    width: 100%;
    height: 10px;
    -webkit-appearance: none;
    appearance: none;
    background: #333;
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}

.replay-progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(206, 65, 43, 0.5);
}

.replay-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
}

.replay-btn {
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
}

.replay-btn-play { background: #4caf50; }
.replay-btn-play:hover { background: #45a049; transform: scale(1.05); }
.replay-btn-pause { background: #ff9800; }
.replay-btn-pause:hover { background: #e68900; transform: scale(1.05); }
.replay-btn-stop { background: #f44336; }
.replay-btn-stop:hover { background: #da190b; transform: scale(1.05); }
.replay-btn-speed { background: #2196f3; padding: 0.6rem 0.8rem; }
.replay-btn-speed:hover { background: #0b7dda; transform: scale(1.05); }
.replay-btn-exit { background: #d32f2f; margin-left: auto; }
.replay-btn-exit:hover { background: #b71c1c; transform: scale(1.05); }

.replay-speed-display {
    color: var(--accent);
    font-weight: bold;
    font-size: 1rem;
    min-width: 40px;
    text-align: center;
}

.btn-dynamic-connect { background: rgba(0, 255, 102, 0.08) !important; color: #00ff66 !important; border: 1px solid rgba(0, 255, 102, 0.3) !important; } .btn-dynamic-connect:hover { background: rgba(0, 255, 102, 0.2) !important; border: 1px solid rgba(0, 255, 102, 0.6) !important; box-shadow: 0 0 15px rgba(0, 255, 102, 0.2); } .btn-dynamic-disconnect { background: rgba(255, 51, 51, 0.08) !important; color: #ff3333 !important; border: 1px solid rgba(255, 51, 51, 0.3) !important; } .btn-dynamic-disconnect:hover { background: rgba(255, 51, 51, 0.2) !important; border: 1px solid rgba(255, 51, 51, 0.6) !important; box-shadow: 0 0 15px rgba(255, 51, 51, 0.2); } .btn-dynamic-edit { background: rgba(255, 255, 255, 0.05) !important; color: #d1d5db !important; border: 1px solid rgba(255, 255, 255, 0.2) !important; } .btn-dynamic-edit:hover { background: rgba(255, 255, 255, 0.1) !important; border: 1px solid rgba(255, 255, 255, 0.4) !important; box-shadow: 0 0 15px rgba(255, 255, 255, 0.1); }

/* Custom Marker UI */
.modal-backdrop { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; justify-content: center; align-items: center; }
.modal-backdrop.hidden { display: none !important; }
.modal { background: var(--bg-card); padding: 20px; border-radius: 8px; width: 300px; max-width: 90%; box-shadow: 0 4px 12px rgba(0,0,0,0.5); border: 1px solid var(--border-subtle); }
.styled-input { width: 100%; padding: 8px; border-radius: 4px; border: 1px solid var(--border-subtle); background: var(--bg-lighter); color: var(--text); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.custom-marker-context-menu { position: absolute; z-index: 1000; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.5); padding: 4px; min-width: 150px; }
.hidden { display: none !important; }

/* Modal Buttons */
.btn { padding: 10px 16px; border: none; border-radius: 6px; font-weight: 600; font-size: 14px; cursor: pointer; transition: all 0.2s ease; }
.btn-primary { background: linear-gradient(135deg, #ff3b30, #ff2a6d); color: white; box-shadow: 0 2px 8px rgba(255, 59, 48, 0.4); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255, 59, 48, 0.6); }
.btn-secondary { background: var(--bg-lighter); color: var(--text-muted); border: 1px solid var(--border-subtle); }
.btn-secondary:hover { background: var(--bg-hover); color: var(--text); transform: translateY(-1px); }
/* Map Zoom Controls */
.map-zoom-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    background: rgba(15, 17, 21, 0.85);
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    z-index: 100;
}
.map-zoom-controls button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.map-zoom-controls button:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: scale(1.05);
}
/* Translator UI */
.translator-container {
    padding: 20px;
    height: 100%;
}
.translator-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    max-width: 800px;
}
.translator-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}
.translator-select {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    min-width: 150px;
    cursor: pointer;
}
.translator-select:focus {
    border-color: var(--accent);
}
/* Options for the translator select dropdown */
.translator-select option {
    background-color: var(--bg-card);
    color: var(--text-primary);
    padding: 10px;
}

/* ---- Ultra Premium Translator Layout ---- */
.premium-translator-card {
    max-width: 900px;
    margin: 0 auto;
    background: rgba(20, 20, 25, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.translator-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px 16px 0 0;
}

.premium-swap-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

.premium-swap-btn:hover {
    background: var(--accent);
    color: #fff;
    transform: rotate(180deg) scale(1.1);
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(var(--accent-rgb), 0.5);
}

.translator-body {
    display: flex;
    flex-direction: row;
    min-height: 200px;
}

.translator-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.translator-body-divider {
    width: 1px;
    background: rgba(255, 255, 255, 0.05);
}

.premium-textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 20px;
    font-size: 16px;
    line-height: 1.5;
    resize: none;
    outline: none;
    transition: background 0.3s;
}

.premium-textarea:focus {
    background: rgba(255, 255, 255, 0.02);
}

.result-textarea {
    color: #a9b1d6;
    background: rgba(0, 0, 0, 0.1);
}

/* Custom Dropdown CSS */
.custom-dropdown {
    position: relative;
    user-select: none;
    width: 200px;
}

.dropdown-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-selected:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.custom-dropdown.open .dropdown-selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.2);
}

.custom-dropdown.open .dropdown-selected svg {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 5px;
    background: rgba(20, 20, 25, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
    max-height: 250px;
    overflow-y: auto;
}

.custom-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 10px 16px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    padding-left: 20px;
}

.dropdown-item.active {
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
    border-left: 2px solid var(--accent);
}

/* Custom scrollbar for dropdown */
.dropdown-menu::-webkit-scrollbar {
    width: 6px;
}
.dropdown-menu::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

/* Animated Server Info Icons */
.server-info-label svg {
    margin-right: 6px;
    vertical-align: text-bottom;
}

@keyframes icon-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); opacity: 0.8; }
    100% { transform: scale(1); }
}

@keyframes icon-spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes icon-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

@keyframes icon-wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
}

@keyframes icon-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

.anim-pulse svg { animation: icon-pulse 2s infinite ease-in-out; }
.anim-spin-slow svg { animation: icon-spin-slow 6s infinite linear; }
.anim-bounce svg { animation: icon-bounce 2s infinite ease-in-out; }
.anim-wiggle svg { animation: icon-wiggle 1.5s infinite ease-in-out; }
.anim-map svg { animation: icon-float 3s infinite ease-in-out; }

/* Add hover pause effect */
.server-info-item:hover svg {
    animation-play-state: paused;
}
/* ============================================
   CCTV
   ============================================ */
.cctv-container {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cctv-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
}

.cctv-input-group {
    display: flex;
    gap: 10px;
}

.cctv-input-group input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    outline: none;
}

.cctv-input-group input:focus {
    border-color: var(--accent);
}

.cctv-btn {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
}

.cctv-btn.primary {
    background: var(--accent);
    color: var(--text-inverse);
}

.cctv-btn.primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 10px rgba(78, 204, 163, 0.4);
}

.cctv-btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.cctv-btn.secondary:hover {
    background: var(--hover-subtle);
}

.cctv-actions {
    display: flex;
    gap: 10px;
}

.cctv-status-row {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    gap: 8px;
    align-items: center;
}

.cctv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.cctv-grid.empty {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    background: var(--bg-secondary);
    border: 1px dashed var(--border-subtle);
    border-radius: 8px;
}

.cctv-tile {
    background: rgba(30, 32, 35, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.cctv-tile.streaming {
    border-color: var(--accent-hot);
    box-shadow: 0 0 15px rgba(255, 51, 102, 0.2);
}

.cctv-tile-header {
    background: var(--bg-tertiary);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--text-primary);
}

.cctv-tile-status {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cctv-tile.streaming .cctv-tile-status {
    background: var(--accent-hot);
    color: #fff;
    box-shadow: 0 0 5px rgba(255, 51, 102, 0.5);
}

.cctv-remove-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.cctv-remove-btn:hover {
    color: var(--accent-hot);
}

.cctv-tile-body {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    cursor: pointer;
    overflow: hidden;
}

.cctv-tile-body img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cctv-tile-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    background: repeating-linear-gradient(
        45deg,
        var(--bg-secondary),
        var(--bg-secondary) 10px,
        var(--bg-tertiary) 10px,
        var(--bg-tertiary) 20px
    );
    opacity: 0.5;
}

.cctv-indicator {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 15px;
}

.cctv-indicator.idle {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.cctv-indicator.streaming {
    background: rgba(255, 51, 102, 0.2);
    color: var(--accent-hot);
    border: 1px solid var(--accent-hot);
}
/* ============================================
   CAMERA STATION MODAL
   ============================================ */
.camera-station-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 17, 21, 0.85);
    backdrop-filter: blur(15px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    padding: 20px;
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
}

.camera-station-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.camera-station-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 32, 35, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px 8px 0 0;
    padding: 10px 20px;
    height: 50px;
}

.cs-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: 1px;
}

.cs-camera-id {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cs-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cs-close:hover {
    color: var(--accent-hot);
}

.camera-station-body {
    flex: 1;
    position: relative;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: none;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cs-feed {
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
}

.cs-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
    z-index: 2;
    background: repeating-linear-gradient(
        45deg,
        rgba(20, 20, 25, 0.9),
        rgba(20, 20, 25, 0.9) 20px,
        rgba(30, 32, 35, 0.9) 20px,
        rgba(30, 32, 35, 0.9) 40px
    );
}

.cs-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
}

.cs-info-box {
    position: absolute;
    background: rgba(20, 20, 25, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    padding: 10px 15px;
    border-radius: 8px;
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
}

.cs-info-box.top-left {
    top: 30px;
    left: 30px;
}

.cs-info-box.top-right {
    top: 30px;
    right: 30px;
    min-width: 200px;
}

.cs-info-title {
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 5px;
    margin-bottom: 5px;
    text-align: center;
}

.cs-crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.8;
}

.cs-controls-container {
    position: absolute;
    inset: 0;
    z-index: 20;
    pointer-events: none; /* Let clicks pass through except on buttons */
}

.cs-ctrl-group {
    position: absolute;
    bottom: 40px;
    display: flex;
    gap: 15px;
    align-items: flex-end;
    pointer-events: auto; /* Buttons are clickable */
}

.cs-ctrl-group.bottom-left {
    left: 40px;
}

.cs-ctrl-group.bottom-center {
    left: 50%;
    transform: translateX(-50%);
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.cs-ctrl-group.bottom-right {
    right: 40px;
}

.cs-wasd {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.cs-wasd-row, .cs-arrows-row {
    display: flex;
    gap: 5px;
}

.cs-mods {
    display: flex;
    gap: 5px;
}

.cs-btn {
    background: rgba(30, 32, 35, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 8px;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    user-select: none;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.1s ease;
}

.cs-btn.wide {
    width: 80px;
    font-size: 12px;
}

.cs-btn:active, .cs-btn.active {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(2px);
    border-color: var(--accent);
    color: var(--accent);
}

.cs-fire {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(30, 32, 35, 0.6);
}

.cs-fire:active, .cs-fire.active {
    background: rgba(255, 51, 102, 0.3);
    border-color: var(--accent-hot);
    color: var(--accent-hot);
}

.cs-label {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

/* Login Animations */
@keyframes fadeIn {
  from { opacity: 0; backdrop-filter: blur(0px); }
  to { opacity: 1; backdrop-filter: blur(15px); }
}
@keyframes scaleUp {
  0% { transform: scale(0.9) translateY(20px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes pulseGlow {
  0% { text-shadow: 0 0 10px rgba(206, 66, 43, 0.4); }
  50% { text-shadow: 0 0 25px rgba(206, 66, 43, 0.8), 0 0 5px rgba(206, 66, 43, 0.5); }
  100% { text-shadow: 0 0 10px rgba(206, 66, 43, 0.4); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.login-input:focus {
  outline: none;
  border-color: var(--rust-primary) !important;
  box-shadow: 0 0 15px rgba(206, 66, 43, 0.2);
}
.login-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(206, 66, 43, 0.3);
}

/* ================================================================
   CALCULATOR TAB
   ================================================================ */
.calculator-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: var(--bg-primary);
    overflow: hidden;
}

.calculator-header {
    margin-bottom: 20px;
}

.calculator-header h2 {
    font-family: var(--font-display);
    color: var(--text-primary);
    margin: 0 0 5px 0;
    font-size: 24px;
}

.calculator-header p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 14px;
}

.calculator-layout {
    display: flex;
    gap: 20px;
    flex: 1;
    overflow: hidden;
}

.calculator-left {
    flex: 0 0 350px;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.calc-search-box {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
}

.calc-search-box svg {
    color: var(--text-muted);
    margin-right: 10px;
}

.calc-search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 100%;
    outline: none;
    font-family: var(--font-primary);
    font-size: 14px;
}

.calc-custom-dropdown {
    position: relative;
    margin-left: 10px;
    min-width: 160px;
    user-select: none;
}

.calc-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.calc-dropdown-toggle:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--border-bright);
}

.calc-dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    width: 200px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    padding: 5px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
}

.calc-dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.calc-dropdown-item {
    padding: 8px 12px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

.calc-dropdown-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
}

.calc-dropdown-item.active {
    background: rgba(206, 66, 43, 0.15);
    color: var(--primary);
    font-weight: 500;
}

.calc-items-grid {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 10px;
    align-content: start;
}

.calc-items-grid::-webkit-scrollbar {
    width: 4px;
}
.calc-items-grid::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.calc-item-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.calc-item-card:hover {
    background: var(--bg-hover);
    border-color: var(--border-bright);
}

.calc-item-card.selected {
    background: rgba(206, 66, 43, 0.15);
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(206, 66, 43, 0.2);
}

.calc-item-card img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 5px;
}

.calc-item-card span {
    font-size: 10px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.calculator-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.calc-details-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

.calc-empty-state {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-align: center;
}

.calc-empty-state svg {
    margin-bottom: 15px;
    opacity: 0.5;
}

.calc-selected-item {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.calc-topbar {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-subtle);
    background: linear-gradient(to right, rgba(206,66,43,0.05), transparent);
}

.calc-topbar img {
    width: 64px;
    height: 64px;
    margin-right: 20px;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

.calc-selected-row {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 15px;
    gap: 15px;
}

.calc-selected-row img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    margin: 0;
}

.calc-row-name {
    flex: 1;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.btn-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-remove:hover {
    color: var(--red);
    background: rgba(255, 36, 36, 0.1);
}

.calc-title-box h3 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
    font-size: 20px;
}

.calc-quantity-controls {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    width: max-content;
}

.calc-quantity-controls button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 5px 15px;
    cursor: pointer;
    font-weight: bold;
}

.calc-quantity-controls button:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.calc-quantity-controls input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 50px;
    text-align: center;
    font-family: var(--font-mono);
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

.calc-quantity-controls input::-webkit-outer-spin-button,
.calc-quantity-controls input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.calc-section {
    padding: 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.calc-section h4 {
    margin: 0 0 15px 0;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.calc-raw-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.calc-raw-item {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.2);
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.calc-raw-item img {
    width: 32px;
    height: 32px;
    margin-right: 10px;
}

.calc-raw-info {
    display: flex;
    flex-direction: column;
}

.calc-raw-name {
    font-size: 12px;
    color: var(--text-primary);
}

.calc-raw-qty {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 14px;
    font-weight: bold;
}

.calc-steps-tree {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
}

.calc-steps-tree::-webkit-scrollbar {
    width: 4px;
}
.calc-steps-tree::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.calc-tree-node {
    margin-bottom: 8px;
}

.calc-tree-node-header {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.02);
    padding: 6px 10px;
    border-radius: 4px;
}

.calc-tree-qty {
    font-family: var(--font-mono);
    color: var(--accent);
    font-weight: bold;
    min-width: 40px;
    font-size: 12px;
}

.calc-tree-icon {
    width: 24px;
    height: 24px;
    margin: 0 10px;
}

.calc-tree-name {
    font-size: 13px;
    color: var(--text-primary);
}

.calc-tree-children {
    padding-left: 20px;
    margin-left: 12px;
    border-left: 1px dashed var(--border-subtle);
    margin-top: 5px;
}

.calc-tree-leaf {
    display: flex;
    align-items: center;
    padding: 4px 10px;
}


/* ================================================================
   UX REFINEMENT LAYER (v3)
   Contrast, header/nav tidy-up, focus states, and the
   "no server connected" empty state (see dashboard-ux.js).
   Kept in one block so it is easy to review or revert.
   ================================================================ */

:root {
    color-scheme: dark;
    /* The old greys were 1.7:1–3.9:1 on the page background; these clear WCAG AA (4.5:1) */
    --text-secondary: #9696b2;
    --text-muted: #7c7c98;
    --text-dim: #4c4c62;
    --border: #23232e;
    --border-bright: #34344a;
}

::selection { background: rgba(230, 0, 0, 0.45); color: #fff; }
html { scrollbar-color: #2e2e3e var(--bg-primary); }

:focus-visible {
    outline: 2px solid #ff5a5a;
    outline-offset: 2px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; }

/* ---- Header: calmer, less to look at ---- */
#header::after { animation: none; opacity: 0.5; }
.lang-btn .flag { display: none; }
.lang-btn { padding: 4px 9px; }
.lang-btn .lang-code { font-size: 11px; letter-spacing: 0.08em; }

#auth-controls { gap: 6px !important; margin-left: 4px !important; }
#auth-controls button,
#logout-btn {
    background: transparent !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-bright) !important;
    border-radius: var(--radius-sm) !important;
    font-family: var(--font-body) !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
#auth-controls button:hover { color: var(--text-primary) !important; border-color: #5a5a76 !important; }
#logout-btn:hover { color: #ff6b6b !important; border-color: rgba(255, 90, 90, 0.5) !important; background: rgba(255, 36, 36, 0.06) !important; }
#admin-panel-btn { color: #ffb84d !important; border-color: rgba(255, 184, 77, 0.35) !important; }

.server-info { gap: 8px; }
.server-name { font-weight: 600; color: var(--text-primary); }

.connection-badge { border-radius: var(--radius-sm); }
.connection-badge.connected { box-shadow: none; }

/* ---- Tab bar: legible, with room to breathe ---- */
#tab-nav { gap: 4px; padding: 0 16px; }
.tab-btn {
    color: var(--text-secondary);
    font-size: 14px;
    letter-spacing: 0.06em;
    padding: 8px 14px;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: #fff; background: rgba(230, 0, 0, 0.12); }
.tab-btn::after { box-shadow: none; }
.nav-sep { height: 18px; margin: 0 8px; background: var(--border-bright); }

/* Labels always stay visible: compact the bar first, wrap to a second row if it still does not fit
   (the bar must stay overflow:visible so the dropdown menus are not clipped). */
#tab-nav { height: auto; min-height: 44px; flex-wrap: wrap; row-gap: 2px; padding-top: 2px; padding-bottom: 2px; }
@media (max-width: 1500px) {
    #tab-nav .tab-btn { font-size: 13px; letter-spacing: 0.04em; padding: 8px 9px; gap: 5px; }
    .nav-sep { margin: 0 4px; }
}
@media (max-width: 1320px) {
    .server-pop { display: none; }
}
/* The legacy <=900px rule hid every tab label; keep them (the bar wraps instead). */
@media (max-width: 900px) {
    #tab-nav .tab-btn span:not(.badge) { display: inline; }
    #tab-nav .tab-btn { font-size: 12.5px; padding: 7px 8px; }
}
@media (max-width: 760px) {
    #header { padding: 0 12px; }
    #logout-btn { font-size: 0 !important; gap: 0 !important; padding: 6px 9px !important; }
    #logout-btn svg { margin: 0; }
    .lang-selector { display: none; }
    #tab-nav .tab-btn { padding: 7px 8px; }
}

/* ---- Empty state: no game server connected ---- */
.no-server-state {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(40rem 24rem at 50% 40%, rgba(191, 0, 0, 0.10), transparent 70%),
        rgba(3, 3, 4, 0.94);
    backdrop-filter: blur(3px);
}
.no-server-state.is-visible { display: flex; }
.no-server-card {
    width: min(560px, 100%);
    background: var(--bg-card);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.no-server-card h2 {
    font-family: var(--font-display);
    font-size: 30px;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    margin: 0 0 8px;
    text-wrap: balance;
}
.no-server-card > p { color: var(--text-secondary); font-size: 15px; line-height: 1.6; margin: 0 0 22px; text-wrap: pretty; }
.no-server-steps { list-style: none; margin: 0 0 26px; padding: 0; counter-reset: ns; border-top: 1px solid var(--border); }
.no-server-steps li {
    counter-increment: ns;
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 14.5px;
    line-height: 1.5;
}
.no-server-steps li::before {
    content: counter(ns);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 20px;
    line-height: 1.2;
    color: var(--accent-hot);
}
.no-server-steps small { display: block; color: var(--text-muted); font-size: 13px; }
.no-server-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.no-server-actions button {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-bright);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.no-server-actions button:hover { border-color: #5a5a76; background: var(--bg-hover); }
.no-server-actions button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.no-server-actions button.primary:hover { background: #d40000; border-color: #d40000; }
.no-server-actions button:active { transform: translateY(1px); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Tab icons were squeezed by the flex row on some tabs; pin them to one size */
#tab-nav .tab-btn > svg:not(.dd-caret) { width: 15px; height: 15px; flex: none; }

/* ================================================================
   Automatic linking dialog (GhostLink, see dashboard-ux.js)
   ================================================================ */
.gl-overlay {
    position: fixed; inset: 0; z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
}
.gl-overlay[hidden] { display: none; }
.gl-dialog {
    width: min(560px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-lg);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.65);
    animation: glIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes glIn { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }
.gl-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px 0;
}
.gl-head h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 26px; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase;
    color: var(--text-primary);
}
.gl-x {
    display: grid; place-items: center; width: 34px; height: 34px;
    border: 1px solid transparent; border-radius: var(--radius-md);
    background: transparent; color: var(--text-secondary); cursor: pointer;
    transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}
.gl-x:hover { color: var(--text-primary); background: var(--bg-hover); border-color: var(--border-bright); }
.gl-body { padding: 8px 24px 24px; }
.gl-intro { margin: 0 0 14px; color: var(--text-secondary); font-size: 14.5px; line-height: 1.6; text-wrap: pretty; }

.gl-status {
    display: flex; align-items: flex-start; gap: 8px;
    margin: 0 0 18px; padding: 9px 12px;
    border-radius: var(--radius-md);
    font-size: 13px; line-height: 1.45;
}
.gl-status svg { flex: none; margin-top: 1px; }
.gl-status.ok { color: #35e0a1; background: var(--green-bg); }
.gl-status.warn { color: #ffc14d; background: var(--yellow-bg); }

.gl-steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.gl-step {
    display: grid; grid-template-columns: 30px 1fr; gap: 14px;
    padding: 16px 0; border-bottom: 1px solid var(--border);
}
.gl-step-mark {
    display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
    font-family: var(--font-display); font-weight: 800; font-size: 15px;
    color: var(--text-secondary); border: 1px solid var(--border-bright); background: var(--bg-elevated);
}
.gl-step-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gl-step-main strong { color: var(--text-primary); font-size: 15px; font-weight: 600; }
.gl-step-main > span { color: var(--text-secondary); font-size: 13.5px; line-height: 1.5; }
.gl-step-main small { color: var(--text-muted); font-size: 12.5px; line-height: 1.45; }
.gl-step[data-state="locked"] { opacity: 0.5; }
.gl-step[data-state="done"] .gl-step-mark { color: #07110d; background: #35e0a1; border-color: #35e0a1; }
.gl-step[data-state="error"] .gl-step-mark { color: #1c1100; background: #ffc14d; border-color: #ffc14d; }
.gl-step[data-state="error"] .gl-step-main > span { color: #ffc14d; }
.gl-step[data-state="active"] .gl-step-mark { border-color: var(--accent-hot); background: transparent; }

.gl-spinner {
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.18); border-top-color: var(--accent-hot);
    animation: glSpin 0.8s linear infinite;
}
@keyframes glSpin { to { transform: rotate(360deg); } }

.gl-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.gl-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 9px 16px;
    font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
    color: var(--text-primary); text-decoration: none;
    background: transparent; border: 1px solid var(--border-bright); border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.gl-btn:hover { background: var(--bg-hover); border-color: #5a5a76; }
.gl-btn:active { transform: translateY(1px); }
.gl-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.gl-btn.primary:hover { background: #d40000; border-color: #d40000; }
.gl-foot { margin: 16px 0 0; color: var(--text-muted); font-size: 12.5px; line-height: 1.5; }


/* ================================================================
   DESIGN SYSTEM v4: one surface scale, one card, one button, one input.
   Everything above stays; this block unifies it. Tokens first, so every
   component that already reads var(--bg-*) / var(--border-*) follows.
   ================================================================ */
:root {
    /* Surface scale: page < panel < card < raised < hover (each step is visibly lighter) */
    --bg-primary: #09090d;
    --bg-secondary: #0d0d13;
    --bg-card: #121219;
    --bg-elevated: #181822;
    --bg-hover: #1f1f2b;
    --bg-lighter: #181822;
    --border-subtle: #1c1c27;
    --border: #262633;
    --border-bright: #373749;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Depth is a soft drop shadow, not a red halo */
    --shadow-deep: 0 18px 50px rgba(0, 0, 0, 0.55);
    --shadow-red: 0 0 0 1px rgba(255, 255, 255, 0.02);
    --glow-red: 0 0 0 0 transparent;
    --glow-green: 0 0 0 0 transparent;
    --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.035) inset, 0 10px 28px rgba(0, 0, 0, 0.30);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

body { background: var(--bg-primary); }

/* ---- Section headers: a real hierarchy ---- */
.section-header { margin-bottom: 20px; }
.section-title { font-size: 26px; letter-spacing: 0.02em; gap: 10px; }
.section-title svg { width: 22px; height: 22px; }
.section-subtitle {
    font-family: var(--font-body);
    font-size: 14.5px;
    letter-spacing: 0;
    color: var(--text-secondary);
    margin-top: 4px;
    margin-left: 32px;
    max-width: 62ch;
    text-wrap: pretty;
}

/* ---- Cards: same recipe everywhere ---- */
.generic-card, .server-card, .cred-card, .cred-form-card, .team-member-card,
.shop-card, .translator-card, .premium-translator-card, .player-stat-card, .stat-card,
.replay-config-card, .replay-howto-card {
    background: var(--bg-card);
    background-image: none;
    backdrop-filter: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}
.generic-card, .server-card, .shop-card {
    transition: border-color 0.2s var(--ease-out), transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.generic-card:hover, .server-card:hover, .shop-card:hover {
    border-color: var(--border-bright);
    transform: translateY(-1px);
}
.server-card.active { border-color: rgba(230, 0, 0, 0.55); }
.cred-card { border-radius: var(--radius-md); }

/* ---- Empty states: readable sentences in a quiet box, not shouting mono ---- */
.chat-empty, .events-empty, .servers-empty, .cred-list-empty, .fcm-log-empty,
.stats-chat-empty, .shop-no-items, .calc-empty-state {
    font-family: var(--font-body);
    font-size: 15px;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-secondary);
    line-height: 1.55;
    text-wrap: balance;
}
.events-empty, .servers-empty, .cred-list-empty, .fcm-log-empty {
    border: 1px dashed var(--border-bright);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.012);
}
.events-empty { height: auto; padding: 36px 20px; }
.servers-empty p { margin: 12px 0 0; }
.servers-empty svg { color: var(--text-dim); }

/* ---- Buttons ---- */
.btn { border-radius: var(--radius-md); font-weight: 600; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: none; }
.btn-primary:hover { background: #d40000; }
.btn-secondary { background: transparent; color: var(--text-primary); border: 1px solid var(--border-bright); }
.btn-secondary:hover { background: var(--bg-hover); }

.modal-btn {
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    letter-spacing: 0.05em;
}
.modal-btn.secondary { background: transparent; color: var(--text-primary); border: 1px solid var(--border-bright); }
.modal-btn.secondary:hover { background: var(--bg-hover); }
.modal-btn.primary { background: var(--accent); color: #fff; }
.modal-btn.primary:hover { background: #d40000; }

.server-connect-btn { border-radius: var(--radius-md); }

/* ---- Inputs: same border, radius and focus in forms and dialogs.
   Scoped on purpose: search boxes, the chat bar and other inputs that sit inside their own
   styled wrapper keep their wrapper's look. ---- */
:is(.modal-body, .cred-form-card, .translator-card, .premium-translator-card, .cctv-input-group, #tab-admin, #tab-translator, .replay-config-card) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]), select, textarea),
.styled-input, .login-input, .guild-select {
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
:is(.modal-body, .cred-form-card, .translator-card, .premium-translator-card, .cctv-input-group, #tab-admin, #tab-translator, .replay-config-card) :is(input, select, textarea):hover,
.styled-input:hover, .guild-select:hover { border-color: #4b4b63; }
:is(.modal-body, .cred-form-card, .translator-card, .premium-translator-card, .cctv-input-group, #tab-admin, #tab-translator, .replay-config-card) :is(input, select, textarea):focus,
.styled-input:focus, .guild-select:focus {
    border-color: var(--accent-hot);
    box-shadow: 0 0 0 3px rgba(230, 0, 0, 0.18);
    outline: none;
}
#app ::placeholder { color: var(--text-muted); }

/* ---- Modals ---- */
.modal-content { border-radius: var(--radius-lg); box-shadow: var(--shadow-deep); animation: glIn 0.28s var(--ease-out) both; }
.modal-header { border-bottom: 1px solid var(--border); }
.modal-footer { border-top: 1px solid var(--border); }
.modal-overlay, .modal-backdrop { backdrop-filter: blur(4px); }

/* ---- Map sidebar and lists ---- */
.team-sidebar { background: var(--bg-secondary); border-left: 1px solid var(--border); }
.sidebar-title {
    font-size: 12.5px; letter-spacing: 0.14em; color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}
.team-member-card { padding: 12px 14px; border-radius: var(--radius-md); }

/* ---- Header/nav surfaces ---- */
#header { background: linear-gradient(180deg, #120808 0%, var(--bg-secondary) 100%); }
#tab-nav { background: var(--bg-secondary); }

/* ---- Thin, quiet scrollbars ---- */
* { scrollbar-width: thin; scrollbar-color: #33334a transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #2e2e42; border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #45455f; background-clip: content-box; border: 2px solid transparent; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---- Tabular numerals wherever data lives ---- */
.server-pop, .server-info-value, .stat-card, .player-stat-card, .calc-item-card { font-variant-numeric: tabular-nums; }


/* ================================================================
   PANELS v5: rebuilt server panel, event/log rows, icon rules and
   illustrated empty states. SVG only, no emoji.
   ================================================================ */
.ui-ico { display: inline-block; flex: none; vertical-align: -0.2em; }
.tod-icon { display: inline-flex; margin-right: 4px; vertical-align: -2px; color: var(--text-secondary); }

/* ---- Server panel ---- */
.server-list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 560px), 1fr)); gap: 16px; align-items: start; }
.srv-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.srv-card:hover { border-color: var(--border-bright); }
.srv-card.active {
    border-color: rgba(230, 0, 0, 0.5);
    background:
        radial-gradient(34rem 12rem at 0% 0%, rgba(230, 0, 0, 0.10), transparent 70%),
        var(--bg-card);
}
.srv-main { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 18px 20px; }
.srv-avatar {
    position: relative; width: 64px; height: 64px; border-radius: 14px; overflow: hidden;
    display: grid; place-items: center;
    background: var(--bg-elevated); border: 1px solid var(--border-bright); color: var(--text-secondary);
}
.srv-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.srv-info { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.srv-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.srv-title {
    margin: 0; min-width: 0;
    font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: 0.01em; line-height: 1.2;
    color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.srv-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 2px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 600; color: #35e0a1; background: var(--green-bg);
}
.srv-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.srv-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.srv-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 6px;
    font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary);
    background: var(--bg-elevated); border: 1px solid var(--border);
}
.srv-desc {
    margin: 0; color: var(--text-secondary); font-size: 13.5px; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* One button language for the whole panel: primary / default / ghost / danger */
.srv-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 8px 14px; border-radius: 8px;
    font-family: var(--font-body); font-size: 13.5px; font-weight: 600; letter-spacing: 0;
    color: var(--text-primary); background: var(--bg-elevated);
    border: 1px solid var(--border-bright);
    cursor: pointer; white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
.srv-btn:hover { background: var(--bg-hover); border-color: #55556f; }
.srv-btn:active { transform: translateY(1px); }
.srv-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.srv-btn.primary:hover { background: #d40000; border-color: #d40000; }
.srv-btn.danger { background: rgba(255, 36, 36, 0.10); border-color: rgba(255, 36, 36, 0.4); color: #ff7a7a; }
.srv-btn.danger:hover { background: rgba(255, 36, 36, 0.18); }
.srv-btn.ghost { background: transparent; border-color: var(--border); color: var(--text-secondary); }
.srv-btn.ghost:hover { color: var(--text-primary); background: var(--bg-hover); }
.srv-btn.ghost-danger { background: transparent; border-color: var(--border); color: var(--text-secondary); }
.srv-btn.ghost-danger:hover { color: #ff7a7a; border-color: rgba(255, 36, 36, 0.45); background: rgba(255, 36, 36, 0.07); }

.srv-tools {
    display: flex; flex-wrap: wrap; gap: 14px 28px;
    padding: 14px 20px 18px;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.18);
}
.srv-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.srv-group-label {
    width: 100%;
    font-size: 11.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted);
}
@media (max-width: 640px) {
    .srv-main { grid-template-columns: 52px minmax(0, 1fr); }
    .srv-main > .srv-btn { grid-column: 1 / -1; }
    .srv-avatar { width: 52px; height: 52px; }
}

/* ---- Event and FCM log rows ---- */
.event-item, .fcm-log-item {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 8px;
    transition: border-color 0.15s, background 0.15s;
}
.event-item:hover, .fcm-log-item:hover { border-color: var(--border-bright); background: var(--bg-elevated); }
.event-icon, .fcm-log-icon {
    display: grid; place-items: center; flex: none;
    width: 38px; height: 38px; border-radius: 10px;
    background: var(--bg-elevated); border: 1px solid var(--border-bright); color: var(--text-secondary);
}
.event-icon.cargo { color: #5aa9ff; background: rgba(90, 169, 255, 0.10); border-color: rgba(90, 169, 255, 0.28); }
.event-icon.heli { color: #ff6b6b; background: rgba(255, 107, 107, 0.10); border-color: rgba(255, 107, 107, 0.28); }
.event-icon.chinook { color: #ffb84d; background: rgba(255, 184, 77, 0.10); border-color: rgba(255, 184, 77, 0.28); }
.event-icon.small, .event-icon.large { color: #35e0a1; background: rgba(53, 224, 161, 0.10); border-color: rgba(53, 224, 161, 0.28); }
.fcm-log-icon.server { color: #5aa9ff; }
.fcm-log-icon.entity { color: #ffb84d; }
.event-text, .fcm-log-text { color: var(--text-primary); font-size: 14.5px; line-height: 1.45; }
.event-time, .fcm-log-time { color: var(--text-muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ---- Illustrated empty states (line art drawn in SVG, tinted with the text colour) ---- */
:is(.chat-empty, .events-empty, .cred-list-empty, .fcm-log-empty) {
    flex-direction: column; gap: 14px;
}
:is(.chat-empty, .events-empty, .cred-list-empty, .fcm-log-empty)::before {
    content: ''; display: block; width: 76px; height: 76px; margin: 0 auto;
    background: var(--text-dim);
    -webkit-mask: var(--empty-art) center / contain no-repeat;
    mask: var(--empty-art) center / contain no-repeat;
}
.chat-empty { --empty-art: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 12h30a4 4 0 0 1 4 4v14a4 4 0 0 1-4 4H22l-8 7v-7H8a4 4 0 0 1-4-4V16a4 4 0 0 1 4-4z'/%3E%3Cpath d='M46 24h10a4 4 0 0 1 4 4v14a4 4 0 0 1-4 4h-2v7l-8-7H34a4 4 0 0 1-4-4v-2'/%3E%3Cpath d='M13 23h.01M21 23h.01M29 23h.01' stroke-width='3'/%3E%3C/svg%3E"); }
.events-empty { --empty-art: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M32 4 54 17v26L32 56 10 43V17z'/%3E%3Cpath d='M35 18 24 34h8l-3 12 11-16h-8z'/%3E%3Cpath d='M32 60v-4M4 17l4 2M60 17l-4 2'/%3E%3C/svg%3E"); }
.cred-list-empty { --empty-art: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='14' width='52' height='36' rx='5'/%3E%3Cpath d='M6 24h52'/%3E%3Ccircle cx='22' cy='38' r='5'/%3E%3Cpath d='M27 38h14M37 38v4M41 38v3'/%3E%3C/svg%3E"); }
.fcm-log-empty { --empty-art: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='32' cy='36' r='4'/%3E%3Cpath d='M32 40v16M26 56h12'/%3E%3Cpath d='M22 26a14 14 0 0 1 20 0M16 20a22 22 0 0 1 32 0M10 14a30 30 0 0 1 44 0'/%3E%3C/svg%3E"); }
:is(.chat-empty, .events-empty, .cred-list-empty, .fcm-log-empty) { text-align: center; }
.fcm-log-empty::before { width: 56px; height: 56px; }

/* Filter chips: pills that read as buttons, not terminal tags */
.filter-btn {
    padding: 6px 14px; border-radius: 999px;
    font-family: var(--font-body); font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none;
}
.filter-btn.active { background: rgba(230, 0, 0, 0.14); border-color: rgba(230, 0, 0, 0.55); color: #fff; box-shadow: none; }
.chat-input { font-family: var(--font-body); }


/* GhostLink: install steps shown when the extension does not answer */
.gl-mini { margin: 8px 0 0; padding-left: 20px; color: var(--text-secondary); font-size: 13px; line-height: 1.6; }
.gl-mini li::marker { color: var(--accent-hot); font-weight: 700; }
.gl-btn.ghost { border-color: transparent; color: var(--text-secondary); }
.gl-btn.ghost:hover { color: var(--text-primary); background: var(--bg-hover); }


/* GhostLink: options shown when the Store extension cannot answer from this origin */
.gl-options { list-style: none; margin: 10px 0 4px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.gl-options > li { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: rgba(255, 255, 255, 0.015); color: var(--text-secondary); font-size: 13.5px; line-height: 1.5; }
.gl-details { width: 100%; }
.gl-details summary { cursor: pointer; color: var(--text-primary); font-weight: 600; font-size: 13px; }


/* ================================================================
   PAGES v6: one layout language for System, Translator and Shops
   (hero, status strip, panel cards, ruled sections). Decoration is a
   faint grid + one red wash per page; everything else is structure.
   ================================================================ */
.pg { height: 100%; overflow-y: auto; padding: 28px clamp(18px, 4vw, 48px) 56px; }
.pg-inner { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.pg-inner.pg-narrow { max-width: 900px; }

/* Hero */
.pg-hero {
    position: relative; isolation: isolate; overflow: hidden;
    display: flex; align-items: center; gap: 20px;
    padding: 24px 28px;
    border: 1px solid var(--border); border-radius: 18px;
    background:
        radial-gradient(40rem 14rem at 0% 0%, rgba(230, 0, 0, 0.13), transparent 70%),
        var(--bg-card);
    box-shadow: var(--shadow-card);
}
.pg-hero::before {
    content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 30px 30px;
    -webkit-mask-image: linear-gradient(100deg, transparent 25%, #000 100%);
    mask-image: linear-gradient(100deg, transparent 25%, #000 100%);
}
.pg-hero-icon {
    flex: none; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 16px;
    color: #ff6060; background: rgba(230, 0, 0, 0.14); border: 1px solid rgba(230, 0, 0, 0.42);
}
.pg-hero-text { min-width: 0; }
.pg-hero-text h2 {
    margin: 0 0 4px; font-family: var(--font-display); font-size: 32px; font-weight: 800;
    letter-spacing: 0.02em; text-transform: uppercase; line-height: 1.05; color: var(--text-primary);
}
.pg-hero-text p { margin: 0; color: var(--text-secondary); font-size: 15px; line-height: 1.5; max-width: 62ch; text-wrap: pretty; }
.pg-hero-meta { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.pg-chip {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
    background: var(--bg-elevated); border: 1px solid var(--border-bright);
    color: var(--text-secondary); font-size: 14px; font-variant-numeric: tabular-nums;
}
.pg-chip strong { color: var(--text-primary); font-size: 16px; }

/* Status strip */
.ps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.ps-item {
    display: flex; align-items: center; gap: 14px; padding: 16px 18px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-card);
}
.ps-icon {
    flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
    background: var(--bg-elevated); border: 1px solid var(--border-bright); color: var(--text-secondary);
}
.ps-item > div { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.ps-label { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.ps-value {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: 0.01em; color: var(--text-primary);
}
.ps-value::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); flex: none; }
.ps-sub { font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-item[data-state="ok"] .ps-icon { color: #35e0a1; background: var(--green-bg); border-color: rgba(53, 224, 161, 0.32); }
.ps-item[data-state="ok"] .ps-value::before { background: #35e0a1; }
.ps-item[data-state="warn"] .ps-icon { color: #ffc14d; background: var(--yellow-bg); border-color: rgba(255, 193, 77, 0.32); }
.ps-item[data-state="warn"] .ps-value::before { background: #ffc14d; }
.ps-item[data-state="bad"] .ps-icon { color: #ff7a7a; background: var(--red-bg); border-color: rgba(255, 90, 90, 0.35); }
.ps-item[data-state="bad"] .ps-value::before { background: #ff5a5a; }

/* Columns */
.pg-cols { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; align-items: start; }
.pg-stack { display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 980px) { .pg-cols { grid-template-columns: 1fr; } .pg-hero { flex-wrap: wrap; } .pg-hero-meta { margin-left: 0; } }

/* Panel card */
.pc {
    display: flex; flex-direction: column; gap: 14px; padding: 22px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-card);
}
.pc-head { display: flex; align-items: center; gap: 14px; }
.pc-icon {
    flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
    background: var(--bg-elevated); border: 1px solid var(--border-bright); color: var(--text-secondary);
}
.pc-title { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pc-title h3, .pc-title h3 label { margin: 0; font-size: 17px; font-weight: 700; color: var(--text-primary); cursor: inherit; }
.pc-title > span { font-size: 13px; color: var(--text-muted); }
.pc-tag {
    margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
    color: #ff7a7a; background: rgba(230, 0, 0, 0.12); border: 1px solid rgba(230, 0, 0, 0.35);
}
.pc-tag.ok { color: #35e0a1; background: var(--green-bg); border-color: rgba(53, 224, 161, 0.32); }
.pc-text { margin: 0; color: var(--text-secondary); font-size: 14.5px; line-height: 1.6; text-wrap: pretty; }
.pc-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pc-input {
    width: 100%; padding: 12px 14px; font-family: var(--font-mono); font-size: 14px; letter-spacing: 0.02em;
    color: var(--text-primary); background: var(--bg-elevated); border: 1px solid var(--border-bright); border-radius: 10px;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.pc-input:hover { border-color: #4b4b63; }
.pc-input:focus { border-color: var(--accent-hot); box-shadow: 0 0 0 3px rgba(230, 0, 0, 0.18); outline: none; }
.pc-code { text-align: center; font-size: 20px; letter-spacing: 0.4em; font-weight: 600; }
.pc-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px;
    font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--text-primary);
    background: var(--bg-elevated); border: 1px solid var(--border-bright); border-radius: 10px; cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s, opacity 0.15s;
}
.pc-btn:hover:not(:disabled) { background: var(--bg-hover); border-color: #55556f; }
.pc-btn:active:not(:disabled) { transform: translateY(1px); }
.pc-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.pc-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.pc-btn.primary:hover:not(:disabled) { background: #d40000; border-color: #d40000; }
.pc-btn.danger { color: #ff7a7a; border-color: rgba(255, 90, 90, 0.4); background: rgba(255, 36, 36, 0.08); }
.pc-btn.danger:hover:not(:disabled) { background: rgba(255, 36, 36, 0.16); }
.pc-verify { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; border-top: 1px solid var(--border); }

/* Primary card: the thing you came here to do */
.pc-primary {
    gap: 18px; padding: 26px;
    border-color: rgba(230, 0, 0, 0.5);
    background:
        radial-gradient(30rem 14rem at 100% 0%, rgba(230, 0, 0, 0.14), transparent 70%),
        var(--bg-card);
}
.pc-primary .pc-icon { color: #ff6060; background: rgba(230, 0, 0, 0.14); border-color: rgba(230, 0, 0, 0.42); }
.pc-steps { list-style: none; margin: 0; padding: 0; counter-reset: st; border-top: 1px solid var(--border); }
.pc-steps li {
    counter-increment: st; display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: baseline;
    padding: 12px 0; border-bottom: 1px solid var(--border); color: var(--text-primary); font-size: 14.5px; line-height: 1.5;
}
.pc-steps li::before { content: counter(st); font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--accent-hot); }
.pc-cta {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 14px 20px;
    font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
    color: #fff; background: var(--accent); border: 1px solid var(--accent); border-radius: 12px; cursor: pointer;
    box-shadow: 0 8px 24px rgba(230, 0, 0, 0.28);
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.pc-cta:hover { background: #d40000; box-shadow: 0 10px 28px rgba(230, 0, 0, 0.36); }
.pc-cta:active { transform: translateY(1px); }

/* Export (only when linked) */
.pc-export { padding: 0; gap: 0; }
.pc-export > summary {
    display: flex; align-items: center; gap: 10px; padding: 16px 22px; cursor: pointer; list-style: none;
    font-weight: 600; font-size: 14.5px; color: var(--text-primary);
}
.pc-export > summary::-webkit-details-marker { display: none; }
.pc-export > summary::after { content: ''; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--text-secondary); border-bottom: 2px solid var(--text-secondary); transform: rotate(45deg); transition: transform 0.2s; }
.pc-export[open] > summary::after { transform: rotate(-135deg); }
.pc-export[open] { gap: 14px; padding-bottom: 22px; }
.pc-export > :not(summary) { margin: 0 22px; }
.pc-command { display: flex; gap: 10px; align-items: flex-start; padding: 12px; background: var(--bg-elevated); border: 1px solid var(--border-bright); border-radius: 10px; }
.pc-command code { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 12.5px; color: #b4bdff; word-break: break-all; filter: blur(5px); transition: filter 0.25s; user-select: all; }
.pc-command:hover code { filter: none; }
.pc-warn { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-radius: 10px; font-size: 13px; line-height: 1.5; color: #ffc14d; background: var(--yellow-bg); }
.pc-warn svg { flex: none; margin-top: 2px; }

/* Ruled section */
.pg-section { display: flex; flex-direction: column; gap: 14px; }
.pg-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.pg-section-head h3 { margin: 0; font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; color: var(--text-primary); }
.pg-section-head p { margin: 2px 0 0; color: var(--text-secondary); font-size: 14px; }

/* Registered credentials: one row per account */
.cred-list { display: flex; flex-direction: column; gap: 10px; }
.cred-card {
    position: relative; display: flex; align-items: center; gap: 16px; margin: 0; padding: 16px 18px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-card);
    transition: border-color 0.15s;
}
.cred-card:hover { border-color: var(--border-bright); }
.cred-card.expired { border-color: rgba(255, 90, 90, 0.5); }
.cc-avatar { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 13px; color: #ff6060; background: rgba(230, 0, 0, 0.12); border: 1px solid rgba(230, 0, 0, 0.35); }
.cc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cc-id { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cc-steam { font-family: var(--font-mono); font-size: 15px; color: var(--text-primary); letter-spacing: 0.02em; }
.cc-tag { padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.cc-tag.ok { color: #35e0a1; background: var(--green-bg); }
.cc-tag.bad { color: #ff7a7a; background: var(--red-bg); }
.cc-meta { display: flex; gap: 6px 18px; flex-wrap: wrap; font-size: 13px; color: var(--text-secondary); }
.cc-meta span { display: inline-flex; align-items: center; gap: 6px; }
.cc-meta .linked { color: #35e0a1; }
.cc-meta .unlinked { color: var(--text-muted); }
.cc-meta .bad { color: #ff7a7a; }
.cc-role { flex: none; padding: 5px 12px; border-radius: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.cc-role.hoster { color: #ff8a8a; background: rgba(230, 0, 0, 0.14); border: 1px solid rgba(230, 0, 0, 0.4); }
.cc-role.member { color: var(--text-secondary); background: var(--bg-elevated); border: 1px solid var(--border-bright); }
.cred-remove-btn {
    flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
    color: var(--text-secondary); background: transparent; border: 1px solid var(--border);
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.cred-remove-btn:hover { color: #ff7a7a; border-color: rgba(255, 90, 90, 0.5); background: rgba(255, 36, 36, 0.08); }
.cred-result { padding: 12px 16px; border-radius: 12px; font-size: 14px; border: 1px solid var(--border-bright); background: var(--bg-card); color: var(--text-primary); }
.cred-result.success { color: #35e0a1; background: var(--green-bg); border-color: rgba(53, 224, 161, 0.35); }
.cred-result.error { color: #ff7a7a; background: var(--red-bg); border-color: rgba(255, 90, 90, 0.4); }
@media (max-width: 640px) { .cred-card { flex-wrap: wrap; } .cc-role { order: 3; } }

/* ---- Translator ---- */
.tr-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-card); overflow: visible; }
.tr-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, 0.015); border-radius: 18px 18px 0 0; }
.tr-bar .custom-dropdown { flex: 1; max-width: 300px; }
.tr-bar .dropdown-selected {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px;
    font-size: 15px; font-weight: 600; color: var(--text-primary);
    background: var(--bg-elevated); border: 1px solid var(--border-bright); border-radius: 12px; cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.tr-bar .dropdown-selected:hover { border-color: #55556f; background: var(--bg-hover); }
.tr-bar .custom-dropdown.open .dropdown-selected { border-color: var(--accent-hot); }
.tr-bar .dropdown-menu {
    background: var(--bg-card); border: 1px solid var(--border-bright); border-radius: 12px; padding: 6px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}
.tr-bar .dropdown-item { padding: 9px 12px; border-radius: 8px; font-size: 14.5px; color: var(--text-secondary); cursor: pointer; }
.tr-bar .dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.tr-bar .dropdown-item.active { color: #fff; background: rgba(230, 0, 0, 0.16); }
.premium-swap-btn {
    flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
    color: var(--text-secondary); background: var(--bg-elevated); border: 1px solid var(--border-bright); cursor: pointer;
    transition: color 0.15s, border-color 0.15s, transform 0.3s var(--ease-out);
}
.premium-swap-btn:hover { color: #fff; border-color: var(--accent-hot); transform: rotate(180deg); }
.tr-panes { display: grid; grid-template-columns: 1fr 1fr; }
.tr-pane { display: flex; flex-direction: column; min-height: 280px; }
.tr-pane + .tr-pane { border-left: 1px solid var(--border); background: rgba(255, 255, 255, 0.012); border-radius: 0 0 18px 0; }
.tr-pane .premium-textarea {
    flex: 1; width: 100%; min-height: 220px; padding: 20px; resize: none; border: 0; outline: 0; background: transparent;
    font-family: var(--font-body); font-size: 18px; line-height: 1.55; color: var(--text-primary);
}
.tr-pane .premium-textarea::placeholder { color: var(--text-muted); }
.tr-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px 14px 20px; }
.tr-meta { font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.tr-tool {
    display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 9px; font-size: 13.5px; font-weight: 600;
    color: var(--text-secondary); background: transparent; border: 1px solid var(--border); cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.tr-tool:hover { color: var(--text-primary); border-color: var(--border-bright); background: var(--bg-hover); }
.tr-tool.done { color: #35e0a1; border-color: rgba(53, 224, 161, 0.4); }
.tr-phrases { display: flex; flex-wrap: wrap; gap: 10px; }
.tr-phrase {
    padding: 9px 15px; border-radius: 999px; font-family: var(--font-body); font-size: 14px; color: var(--text-primary);
    background: var(--bg-card); border: 1px solid var(--border-bright); cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.tr-phrase:hover { background: var(--bg-hover); border-color: rgba(230, 0, 0, 0.5); }
.tr-phrase:active { transform: translateY(1px); }
@media (max-width: 760px) {
    .tr-panes { grid-template-columns: 1fr; }
    .tr-pane + .tr-pane { border-left: 0; border-top: 1px solid var(--border); border-radius: 0 0 18px 18px; }
    .tr-bar { flex-wrap: wrap; }
}

/* ---- Shops ---- */
.shop-toolbar { display: flex; align-items: center; gap: 14px 22px; flex-wrap: wrap; padding: 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-card); }
.shop-search { flex: 1 1 320px; display: flex; align-items: center; gap: 10px; padding: 0 14px; color: var(--text-secondary); background: var(--bg-elevated); border: 1px solid var(--border-bright); border-radius: 12px; transition: border-color 0.15s, box-shadow 0.15s; }
.shop-search:focus-within { border-color: var(--accent-hot); box-shadow: 0 0 0 3px rgba(230, 0, 0, 0.18); }
.shop-search .shop-search-input { flex: 1; min-width: 0; padding: 13px 0; border: 0; outline: 0; background: transparent; box-shadow: none; font-family: var(--font-body); font-size: 15.5px; color: var(--text-primary); }
.shop-toggles { display: flex; gap: 18px; flex-wrap: wrap; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 16px; align-items: start; padding: 0; }
.shop-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; border-radius: 16px; }
.shop-header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, 0.02); }
.shop-ico { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: #ffb84d; background: var(--yellow-bg); border: 1px solid rgba(255, 184, 77, 0.3); }
.shop-name { flex: 1; min-width: 0; font-size: 15.5px; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-grid-pos { flex: none; padding: 3px 10px; border-radius: 6px; font-family: var(--font-mono); font-size: 12.5px; color: var(--text-secondary); background: var(--bg-elevated); border: 1px solid var(--border-bright); }
.shop-items { list-style: none; margin: 0; padding: 6px 0; }
.shop-item-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border-subtle); }
.shop-item-row:last-child { border-bottom: 0; }
.shop-item-row.out-of-stock { opacity: 0.55; }
.shop-item-quantity { min-width: 34px; text-align: center; padding: 2px 8px; border-radius: 6px; font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; color: var(--text-primary); background: var(--bg-elevated); border: 1px solid var(--border-bright); }
.shop-item-name { min-width: 0; font-size: 14.5px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-stock { padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.shop-stock.ok { color: #35e0a1; background: var(--green-bg); }
.shop-stock.low { color: #ffc14d; background: var(--yellow-bg); }
.shop-stock.out { color: #ff7a7a; background: var(--red-bg); }
.shop-item-cost { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.shop-item-cost svg { color: #ffb84d; }
.shop-item-cost b { color: var(--text-primary); font-size: 14.5px; }
.shop-no-items { padding: 22px 16px; text-align: center; font-size: 14px; color: var(--text-muted); }
.shop-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 56px 20px; color: var(--text-secondary); border: 1px dashed var(--border-bright); border-radius: 16px; text-align: center; }
.shop-empty svg { color: var(--text-dim); }
.shop-empty p { margin: 0; font-size: 15px; }
@media (max-width: 520px) { .shop-item-row { grid-template-columns: auto minmax(0, 1fr) auto; } .shop-stock { display: none; } }


/* ================================================================
   CALCULATOR v7: crafting + raiding on the shared page language.
   Left: a sticky picker. Right: the result, in three clear blocks
   (what you chose, what it costs, how to make it).
   ================================================================ */
.pg-inner.pg-wide { max-width: 1320px; }

/* Segmented switch (Crafting / Raiding) */
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--bg-elevated); border: 1px solid var(--border-bright); border-radius: 12px; }
.seg-btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border: 0; border-radius: 9px; cursor: pointer;
    font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
    color: var(--text-secondary); background: transparent; transition: color 0.15s, background 0.15s;
}
.seg-btn:hover { color: var(--text-primary); }
.seg-btn.active { color: #fff; background: var(--accent); box-shadow: 0 4px 14px rgba(230, 0, 0, 0.3); }

#tab-calculator .calculator-layout { display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); gap: 18px; align-items: start; }
#tab-calculator .calculator-layout.hidden { display: none; }
#tab-calculator .calculator-left {
    position: sticky; top: 0; width: auto; display: flex; flex-direction: column; gap: 14px; padding: 16px;
    max-height: calc(100vh - 170px); overflow: hidden;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-card);
}
#tab-calculator .calculator-right { min-width: 0; width: auto; }
#tab-calculator .calc-details-panel {
    min-height: 460px; overflow: hidden; background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-card);
}
@media (max-width: 1000px) {
    #tab-calculator .calculator-layout { grid-template-columns: 1fr; }
    #tab-calculator .calculator-left { position: static; max-height: 520px; }
}

/* Search + category */
#tab-calculator .calc-search-box {
    display: flex; align-items: center; gap: 10px; padding: 0 10px 0 14px; position: relative;
    color: var(--text-secondary); background: var(--bg-elevated); border: 1px solid var(--border-bright); border-radius: 12px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
#tab-calculator .calc-search-box:focus-within { border-color: var(--accent-hot); box-shadow: 0 0 0 3px rgba(230, 0, 0, 0.18); }
#tab-calculator .calc-search-box input {
    flex: 1; min-width: 0; padding: 12px 0; border: 0; outline: 0; background: transparent; box-shadow: none;
    font-family: var(--font-body); font-size: 15px; color: var(--text-primary);
}
#tab-calculator .calc-dropdown-toggle {
    display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; cursor: pointer;
    font-size: 13.5px; font-weight: 600; color: var(--text-primary); background: var(--bg-hover); border: 1px solid var(--border-bright);
}
#tab-calculator .calc-dropdown-menu {
    background: var(--bg-card); border: 1px solid var(--border-bright); border-radius: 12px; padding: 6px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}
#tab-calculator .calc-dropdown-item { padding: 8px 12px; border-radius: 8px; font-size: 14px; color: var(--text-secondary); cursor: pointer; }
#tab-calculator .calc-dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
#tab-calculator .calc-dropdown-item.active { color: #fff; background: rgba(230, 0, 0, 0.16); }

.calc-step-title { margin: 4px 0 0; font-family: var(--font-display); font-size: 19px; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-primary); }

/* Item picker grid */
#tab-calculator .calc-items-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px;
    overflow-y: auto; padding: 2px 4px 2px 0; min-height: 120px;
}
#tab-calculator .calculator-left > .calc-items-grid { flex: 1 1 auto; }
#tab-calculator #calc-structures-grid { flex: 0 1 auto; max-height: 300px; }
#tab-calculator .calc-item-card {
    display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 10px 6px 9px; cursor: pointer; text-align: center;
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
#tab-calculator .calc-item-card:hover { border-color: rgba(230, 0, 0, 0.55); background: var(--bg-hover); transform: translateY(-1px); }
#tab-calculator .calc-item-card:active { transform: translateY(0); }
#tab-calculator .calc-item-card img { width: 50px; height: 50px; object-fit: contain; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5)); }
#tab-calculator .calc-item-card span { font-size: 12px; line-height: 1.25; color: var(--text-secondary); word-break: break-word; }
#tab-calculator .calc-item-card:hover span { color: var(--text-primary); }

/* Empty state */
#tab-calculator .calc-empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 460px; padding: 30px; text-align: center;
    color: var(--text-dim);
}
#tab-calculator .calc-empty-state.hidden { display: none; }
#tab-calculator .calc-empty-state p { margin: 0; max-width: 34ch; font-size: 15.5px; line-height: 1.55; color: var(--text-secondary); }

/* Result blocks */
#tab-calculator .calc-selected-item { display: flex; flex-direction: column; gap: 26px; padding: 24px; }
#tab-calculator .calc-selected-item.hidden { display: none; }
#tab-calculator .calc-topbar, #tab-calculator .calc-title-box { width: 100%; }
#tab-calculator .calc-title-box h3, #tab-calculator .calc-section h4 {
    margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
    font-family: var(--font-display); font-size: 21px; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-primary);
}
.calc-selected-list { display: flex; flex-direction: column; gap: 10px; }
#tab-calculator .calc-selected-row {
    display: flex; align-items: center; gap: 14px; padding: 10px 14px;
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px;
}
#tab-calculator .calc-selected-row img { width: 42px; height: 42px; object-fit: contain; flex: none; }
#tab-calculator .calc-row-name { flex: 1; min-width: 0; font-size: 15.5px; font-weight: 600; color: var(--text-primary); }
#tab-calculator .calc-quantity-controls { display: inline-flex; align-items: center; border: 1px solid var(--border-bright); border-radius: 10px; overflow: hidden; background: var(--bg-card); }
#tab-calculator .calc-quantity-controls button { width: 34px; height: 34px; border: 0; background: transparent; color: var(--text-primary); font-size: 18px; line-height: 1; cursor: pointer; transition: background 0.15s; }
#tab-calculator .calc-quantity-controls button:hover { background: var(--bg-hover); }
#tab-calculator .qty-input { width: 58px; height: 34px; padding: 0; border: 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border); border-radius: 0; background: transparent; text-align: center; font-size: 15px; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
#tab-calculator .qty-input::-webkit-outer-spin-button, #tab-calculator .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#tab-calculator .btn-remove {
    display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-size: 18px; line-height: 1;
    color: var(--text-secondary); background: transparent; border: 1px solid var(--border); transition: color 0.15s, border-color 0.15s, background 0.15s;
}
#tab-calculator .btn-remove:hover { color: #ff7a7a; border-color: rgba(255, 90, 90, 0.5); background: rgba(255, 36, 36, 0.08); }

/* Raw material tiles */
#tab-calculator .calc-raw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
#tab-calculator .calc-raw-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px; }
#tab-calculator .calc-raw-item img { width: 42px; height: 42px; object-fit: contain; flex: none; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45)); }
#tab-calculator .calc-raw-info { display: flex; flex-direction: column; min-width: 0; }
#tab-calculator .calc-raw-qty { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1.05; color: #ffb84d; font-variant-numeric: tabular-nums; }
#tab-calculator .calc-raw-name { font-size: 13px; color: var(--text-secondary); }

/* Crafting steps tree */
#tab-calculator .calc-steps-tree { padding: 14px 16px; background: rgba(0, 0, 0, 0.2); border: 1px solid var(--border); border-radius: 14px; max-height: none; overflow: visible; }
#tab-calculator .calc-tree-node-header, #tab-calculator .calc-tree-leaf { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 8px; }
#tab-calculator .calc-tree-node-header:hover { background: var(--bg-hover); }
#tab-calculator .calc-tree-qty { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: #ffb84d; min-width: 38px; }
#tab-calculator .calc-tree-name { font-size: 14.5px; color: var(--text-primary); }
#tab-calculator .calc-tree-children { margin-left: 18px; padding-left: 14px; border-left: 1px dashed var(--border-bright); }

/* Raiding: explosive filter */
.rx-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding-right: 4px; min-height: 80px; }
.rx-option {
    display: flex; align-items: center; gap: 12px; padding: 9px 12px; cursor: pointer; font-size: 14.5px; font-weight: 500; color: var(--text-primary);
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; transition: border-color 0.15s, background 0.15s, opacity 0.15s;
}
.rx-option:hover { border-color: var(--border-bright); background: var(--bg-hover); }
.rx-option.off { opacity: 0.5; }
.rx-option input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; flex: none; }
.rx-option img { width: 30px; height: 30px; object-fit: contain; flex: none; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)); }

/* Raiding: target structures and their cheapest path */
.rt-card { display: flex; flex-direction: column; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.rt-head { display: flex; align-items: center; gap: 14px; padding: 12px 14px; }
.rt-img { width: 46px; height: 46px; object-fit: contain; flex: none; border-radius: 8px; background: rgba(0, 0, 0, 0.25); }
.rt-info { flex: 1; min-width: 0; }
.rt-name { font-size: 15.5px; font-weight: 700; color: var(--text-primary); }
.rt-hp { display: inline-flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12.5px; color: var(--text-muted); }
.rt-hp b { color: #35e0a1; font-variant-numeric: tabular-nums; }
.rt-ctrl { display: flex; align-items: center; gap: 8px; }
.rt-qty { display: inline-flex; align-items: center; border: 1px solid var(--border-bright); border-radius: 10px; overflow: hidden; background: var(--bg-card); }
.rt-qty button { width: 34px; height: 34px; border: 0; background: transparent; color: var(--text-primary); font-size: 18px; line-height: 1; cursor: pointer; transition: background 0.15s; }
.rt-qty button:hover { background: var(--bg-hover); }
.rt-qty span { min-width: 34px; text-align: center; font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.raid-remove-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; cursor: pointer; color: var(--text-secondary); background: transparent; border: 1px solid var(--border); transition: color 0.15s, border-color 0.15s, background 0.15s; }
.raid-remove-btn:hover { color: #ff7a7a; border-color: rgba(255, 90, 90, 0.5); background: rgba(255, 36, 36, 0.08); }
.rt-result { padding: 12px 14px; border-top: 1px solid var(--border); background: rgba(0, 0, 0, 0.16); }
.rt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rt-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 9px; font-size: 13.5px; color: var(--text-primary); background: var(--bg-card); border: 1px solid var(--border-bright); }
.rt-chip img { width: 22px; height: 22px; object-fit: contain; }
.rt-chip b { font-variant-numeric: tabular-nums; }
.rt-per { font-size: 12px; color: var(--text-muted); }
.rt-dmg { font-size: 12px; color: #ff8a8a; }
.rt-none { font-size: 13px; font-style: italic; color: var(--text-muted); }

/* Calculator: the result blocks sit directly on the panel (old topbar gradient removed) */
#tab-calculator .calc-topbar, #tab-calculator .calc-title-box { background: none; border: 0; padding: 0; box-shadow: none; }
#tab-calculator .calc-details-panel > .calc-selected-item { background: none; }
.rt-chip img { flex: none; }


/* ================================================================
   WINDOWS v8: confirm dialog + switches share the GhostLink dialog look
   ================================================================ */
.gl-overlay.hidden { display: none !important; }
.cf-dialog {
    width: min(420px, 100%); padding: 28px 26px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
    background: var(--bg-card); border: 1px solid var(--border-bright); border-radius: 18px; box-shadow: var(--shadow-deep);
    animation: glIn 0.28s var(--ease-out) both;
}
.cf-icon { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 4px; border-radius: 16px; color: #ff7a7a; background: var(--red-bg); border: 1px solid rgba(255, 90, 90, 0.4); }
.cf-dialog h3 { margin: 0; font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; color: var(--text-primary); }
.cf-dialog p { margin: 0 0 8px; color: var(--text-secondary); font-size: 14.5px; line-height: 1.6; text-wrap: pretty; }
.cf-actions { display: flex; gap: 10px; width: 100%; margin-top: 6px; }
.cf-actions .gl-btn { flex: 1; padding: 11px 16px; }
.gl-btn.danger { color: #fff; background: #c4262c; border-color: #c4262c; }
.gl-btn.danger:hover { background: #d92f36; border-color: #d92f36; }

/* One switch everywhere */
.custom-toggle {
    width: 40px; height: 22px; border-radius: 999px; background: var(--bg-elevated); border: 1px solid var(--border-bright);
    transition: background 0.2s, border-color 0.2s;
}
.custom-toggle::after { top: 2px; left: 2px; width: 16px; height: 16px; background: #8c8ca6; transition: transform 0.2s var(--ease-out), background 0.2s; }
.custom-toggle:checked { background: var(--accent); border-color: var(--accent); }
.custom-toggle:checked::after { background: #fff; transform: translateX(18px); }
.custom-toggle:focus-visible { outline: 2px solid #ff5a5a; outline-offset: 2px; }


/* ================================================================
   DEVICE / TRACKER / ACTIVITY CARDS v9: one card anatomy everywhere
   (icon tile + title + state pill, optional body, action footer).
   ================================================================ */
/* Loading indicators are essential feedback, not decoration: they keep moving even when the OS
   has animations turned off (prefers-reduced-motion). Everything else still respects it. */
@media (prefers-reduced-motion: reduce) {
    .gl-spinner { animation: glSpin 0.9s linear infinite !important; animation-duration: 0.9s !important; animation-iteration-count: infinite !important; }
}

.dv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; align-items: start; }
.dv-card {
    display: flex; flex-direction: column; gap: 14px; padding: 18px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-card);
    transition: border-color 0.2s var(--ease-out);
}
.dv-card:hover { border-color: var(--border-bright); }
.dv-card.dv-wide { grid-column: span 2; }
@media (max-width: 820px) { .dv-card.dv-wide { grid-column: span 1; } }

.dv-head { display: flex; align-items: center; gap: 14px; }
.dv-icon {
    position: relative; flex: none; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 15px;
    background: var(--bg-elevated); border: 1px solid var(--border-bright); color: var(--text-secondary);
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.dv-icon img { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.55)); }
.dv-card[data-state="on"] .dv-icon { background: var(--green-bg); border-color: rgba(53, 224, 161, 0.4); color: #35e0a1; }
.dv-card[data-state="unknown"] .dv-icon { background: var(--yellow-bg); border-color: rgba(255, 193, 77, 0.4); color: #ffc14d; }
.dv-card[data-state="mixed"] .dv-icon { background: rgba(110, 168, 255, 0.10); border-color: rgba(110, 168, 255, 0.4); color: #6ea8ff; }
.dv-count {
    position: absolute; top: -7px; right: -7px; min-width: 22px; padding: 1px 6px; border-radius: 999px; text-align: center;
    font-size: 11.5px; font-weight: 800; color: #fff; background: var(--accent); border: 2px solid var(--bg-card); font-variant-numeric: tabular-nums;
}
.dv-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dv-title h3 { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.25; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-sub { font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-cmd { align-self: flex-start; padding: 2px 9px; border-radius: 6px; font-family: var(--font-mono); color: #8fb8ff; background: rgba(110, 168, 255, 0.10); }

.dv-pill {
    flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px;
    font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--text-secondary); background: var(--bg-elevated);
}
.dv-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dv-pill.on { color: #35e0a1; background: var(--green-bg); }
.dv-pill.off { color: #ff8a8a; background: var(--red-bg); }
.dv-pill.unknown { color: #ffc14d; background: var(--yellow-bg); }
.dv-pill.mixed { color: #8fb8ff; background: rgba(110, 168, 255, 0.12); }

.dv-body { display: flex; align-items: center; gap: 10px; padding: 11px 14px; color: var(--text-secondary); font-size: 14px; background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border-subtle); border-radius: 12px; }
.dv-body strong { color: var(--text-primary); }
.dv-body svg { color: var(--text-muted); flex: none; }
.dv-body.dv-col { flex-direction: column; align-items: stretch; background: none; border: 0; padding: 0; gap: 10px; }
.dv-label { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.dv-label b { margin-left: 4px; padding: 1px 8px; border-radius: 999px; background: var(--bg-elevated); color: var(--text-primary); letter-spacing: 0; }
.dv-empty-line { padding: 14px; text-align: center; font-size: 13.5px; color: var(--text-muted); border: 1px dashed var(--border-bright); border-radius: 12px; }

.dv-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.dv-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 11px; border-radius: 8px; font-size: 13px; color: var(--text-primary); background: var(--bg-elevated); border: 1px solid var(--border); }
.dv-chip b { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--text-muted); }

.dv-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.dv-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 12px; border-radius: 10px; cursor: pointer;
    font-family: var(--font-body); font-size: 13.5px; font-weight: 600; color: var(--text-primary);
    background: var(--bg-elevated); border: 1px solid var(--border-bright);
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
.dv-btn:hover { background: var(--bg-hover); border-color: #55556f; }
.dv-btn:active { transform: translateY(1px); }
.dv-btn.on { color: #35e0a1; background: var(--green-bg); border-color: rgba(53, 224, 161, 0.35); }
.dv-btn.on:hover { background: rgba(53, 224, 161, 0.16); }
.dv-btn.off { color: var(--text-secondary); }
.dv-btn.danger { color: #ff8a8a; border-color: rgba(255, 90, 90, 0.35); }
.dv-btn.danger:hover { background: rgba(255, 36, 36, 0.10); border-color: rgba(255, 90, 90, 0.55); }

.dv-add {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 150px; cursor: pointer;
    color: var(--text-secondary); background: transparent; border: 1px dashed var(--border-bright); border-radius: 16px;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.dv-add strong { font-size: 14.5px; font-weight: 600; }
.dv-add:hover { color: var(--text-primary); border-color: rgba(230, 0, 0, 0.55); background: rgba(230, 0, 0, 0.05); }

/* Tracker players */
.tp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tp-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; }
.tp-avatar { flex: none; width: 40px; height: 40px; border-radius: 11px; object-fit: cover; border: 1px solid var(--border-bright); }
.tp-initial { display: grid; place-items: center; font-weight: 800; font-size: 16px; color: #ff8a8a; background: rgba(230, 0, 0, 0.12); }
.tp-main { flex: 1; min-width: 0; }
.tp-name { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.tp-name strong { font-size: 14.5px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-nick { font-size: 13px; color: #ffc14d; white-space: nowrap; }
.tp-meta { display: flex; align-items: center; gap: 14px; margin-top: 2px; font-size: 12.5px; color: var(--text-muted); flex-wrap: wrap; }
.tp-link { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; font-size: 12.5px; color: var(--accent-hot); text-decoration: none; }
.tp-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Activity log */
.activity-list { display: flex; flex-direction: column; gap: 10px; }
.activity-item {
    display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin: 0;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; transition: border-color 0.15s;
}
.activity-item:hover { border-color: var(--border-bright); }
.act-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--bg-elevated); border: 1px solid var(--border-bright); color: var(--text-secondary); }
.act-death .act-icon { color: #ff8a8a; background: var(--red-bg); border-color: rgba(255, 90, 90, 0.35); }
.act-event .act-icon { color: #8fb8ff; background: rgba(110, 168, 255, 0.10); border-color: rgba(110, 168, 255, 0.35); }
.act-conn .act-icon { color: #35e0a1; background: var(--green-bg); border-color: rgba(53, 224, 161, 0.35); }
.act-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.act-msg { font-size: 14.5px; line-height: 1.45; color: var(--text-primary); }
.act-meta { font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.act-meta b { font-weight: 600; color: var(--text-secondary); }
.activity-delete-btn { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; cursor: pointer; color: var(--text-muted); background: transparent; border: 1px solid transparent; transition: color 0.15s, border-color 0.15s, background 0.15s; }
.activity-delete-btn:hover { color: #ff8a8a; border-color: rgba(255, 90, 90, 0.4); background: rgba(255, 36, 36, 0.07); }


/* ================================================================
   NO-SERVER WINDOW v10: closable, with a reminder pill and an
   "action needs a server" toast. Nothing here depends on animation.
   ================================================================ */
.nosrv-card {
    position: relative; width: min(780px, 100%); padding: 38px 42px 32px;
    display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
    background:
        radial-gradient(28rem 12rem at 50% 0%, rgba(230, 0, 0, 0.10), transparent 70%),
        var(--bg-card);
    border: 1px solid var(--border-bright); border-radius: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.nosrv-small { max-width: 480px; padding: 36px 32px; }
.nosrv-x {
    position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 38px; height: 38px;
    border-radius: 10px; cursor: pointer; color: var(--text-secondary); background: transparent; border: 1px solid var(--border);
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.nosrv-x:hover { color: var(--text-primary); border-color: var(--border-bright); background: var(--bg-hover); }
.nosrv-art { width: 112px; height: 90px; margin-bottom: 4px; color: var(--text-secondary); }
.nosrv-art svg { width: 100%; height: 100%; }
.nosrv-card h2 { margin: 0; font-family: var(--font-display); font-size: 36px; font-weight: 800; line-height: 1.05; letter-spacing: 0.02em; text-transform: uppercase; color: var(--text-primary); text-wrap: balance; }
.nosrv-card > p { margin: 0; max-width: 54ch; font-size: 15.5px; line-height: 1.6; color: var(--text-secondary); text-wrap: pretty; }
.nosrv-steps { list-style: none; margin: 16px 0 6px; padding: 0; width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.nosrv-steps li {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 14px 16px;
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 16px;
}
.nosrv-n { position: absolute; top: 10px; left: 14px; font-family: var(--font-display); font-weight: 800; font-size: 17px; color: var(--accent-hot); }
.nosrv-sico { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 4px; border-radius: 12px; color: #ff6060; background: rgba(230, 0, 0, 0.12); border: 1px solid rgba(230, 0, 0, 0.35); }
.nosrv-steps strong { font-size: 15.5px; color: var(--text-primary); }
.nosrv-steps li > span:last-child { font-size: 13px; line-height: 1.45; color: var(--text-secondary); }
.nosrv-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; align-items: center; margin-top: 12px; }
.nosrv-actions button {
    display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 12px; cursor: pointer;
    font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
    color: var(--text-primary); background: var(--bg-elevated); border: 1px solid var(--border-bright);
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.nosrv-actions button:hover { background: var(--bg-hover); border-color: #55556f; }
.nosrv-actions button:active { transform: translateY(1px); }
.nosrv-actions button.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.nosrv-actions button.primary:hover { background: #d40000; border-color: #d40000; }
.nosrv-actions button.link { padding: 11px 10px; border: 0; background: none; color: var(--text-secondary); text-transform: none; font-family: var(--font-body); font-size: 14.5px; font-weight: 600; letter-spacing: 0; text-decoration: underline; text-underline-offset: 4px; }
.nosrv-actions button.link:hover { color: var(--text-primary); background: none; }
@media (max-width: 720px) { .nosrv-card { padding: 34px 20px 24px; } .nosrv-steps { grid-template-columns: 1fr; } .nosrv-card h2 { font-size: 28px; } }

/* Reminder pill once the window was closed */
.nosrv-banner {
    position: absolute; left: 18px; bottom: 18px; z-index: 35; display: none; align-items: center; gap: 10px;
    padding: 7px 7px 7px 14px; border-radius: 999px; font-size: 13.5px; color: var(--text-secondary);
    background: var(--bg-card); border: 1px solid rgba(255, 193, 77, 0.4); box-shadow: var(--shadow-deep);
}
.nosrv-banner.is-visible { display: inline-flex; }
.nosrv-dot { width: 8px; height: 8px; border-radius: 50%; background: #ffc14d; }
.nosrv-banner button { padding: 6px 14px; border: 0; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 13px; color: #fff; background: var(--accent); }
.nosrv-banner button:hover { background: #d40000; }

/* "This needs a server" toast */
.ux-toast {
    position: fixed; left: 50%; bottom: 28px; z-index: 12000; display: flex; align-items: center; gap: 12px;
    padding: 12px 12px 12px 16px; border-radius: 14px; font-size: 14.5px; color: var(--text-primary);
    background: var(--bg-card); border: 1px solid rgba(255, 193, 77, 0.45); box-shadow: var(--shadow-deep);
    opacity: 0; transform: translate(-50%, 18px); pointer-events: none; transition: opacity 0.2s, transform 0.25s var(--ease-out);
}
.ux-toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.ux-toast svg { color: #ffc14d; flex: none; }
.ux-toast button { padding: 7px 14px; border: 0; border-radius: 9px; cursor: pointer; font-weight: 700; font-size: 13px; color: #fff; background: var(--accent); }
.ux-toast button:hover { background: #d40000; }


/* Reminder strip (replaces the floating pill) */
.nosrv-banner {
    position: static; left: auto; bottom: auto; width: 100%; justify-content: center; gap: 12px; padding: 7px 16px;
    border: 0; border-bottom: 1px solid rgba(255, 193, 77, 0.28); border-radius: 0; box-shadow: none;
    background: rgba(255, 193, 77, 0.07); color: #ffd98a; font-size: 13.5px; flex: none;
}


/* ================================================================
   DISCORD CARD v11: profile of the linked account / live preview
   ================================================================ */
.dc-profile { display: flex; align-items: center; gap: 18px; padding: 4px 0 2px; }
.dc-profile[hidden], .dc-input-wrap[hidden], .dc-preview[hidden] { display: none; }
.dc-avatar {
    flex: none; width: 88px; height: 88px; border-radius: 50%; object-fit: cover;
    border: 3px solid var(--bg-card); box-shadow: 0 0 0 2px #5865f2, 0 10px 24px rgba(0, 0, 0, 0.45);
    background: var(--bg-elevated);
}
.dc-avatar-blank { display: grid; place-items: center; color: var(--text-muted); }
.dc-loading { box-shadow: 0 0 0 2px var(--border-bright); }
.dc-info { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.dc-names { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dc-name { font-family: var(--font-display); font-size: 28px; font-weight: 800; line-height: 1.05; letter-spacing: 0.01em; color: var(--text-primary); overflow-wrap: anywhere; }
.dc-user { font-size: 14px; color: var(--text-secondary); }
.dc-tag { padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: var(--text-secondary); background: var(--bg-elevated); border: 1px solid var(--border-bright); }
.dc-tag.admin { color: #ffc14d; background: var(--yellow-bg); border-color: rgba(255, 193, 77, 0.35); }
.dc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.dc-chip { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: 8px; font-size: 12.5px; color: var(--text-primary); background: var(--bg-elevated); border: 1px solid var(--border); }
.dc-chip b { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: var(--text-muted); }
.dc-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.dc-role { display: inline-flex; align-items: center; gap: 7px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; color: var(--text-primary); background: var(--bg-elevated); border: 1px solid var(--border-bright); }
.dc-role i { width: 9px; height: 9px; border-radius: 50%; }
.dc-id {
    align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; margin-top: 2px; padding: 3px 9px; cursor: pointer;
    font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); background: transparent; border: 1px dashed var(--border-bright); border-radius: 7px;
    transition: color 0.15s, border-color 0.15s;
}
.dc-id:hover { color: var(--text-primary); border-color: #5a5a76; }

.dc-input-wrap { display: flex; flex-direction: column; gap: 8px; }
.dc-label { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.dc-preview { border-radius: 14px; }
.dc-preview.note { padding: 10px 14px; font-size: 13.5px; color: var(--text-secondary); background: var(--bg-elevated); border: 1px dashed var(--border-bright); }
.dc-preview.note.bad { color: #ff9a9a; border-color: rgba(255, 90, 90, 0.4); background: var(--red-bg); }
.dc-preview.found { padding: 12px 14px; background: rgba(88, 101, 242, 0.08); border: 1px solid rgba(88, 101, 242, 0.4); }
.dc-ask { margin-bottom: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #9aa5ff; }
.dc-profile.compact { gap: 12px; padding: 0; }
.dc-profile.compact .dc-avatar { width: 48px; height: 48px; border-width: 2px; }
.dc-profile.compact .dc-name { font-size: 20px; }
.dc-profile.compact .dc-user { font-size: 13px; }
@media (max-width: 520px) { .dc-profile { flex-direction: column; text-align: center; } .dc-info { align-items: center; } .dc-chips, .dc-roles, .dc-names { justify-content: center; } }


/* polish */
.activity-item { font-family: var(--font-body); }
.dc-profile { align-items: flex-start; }
.dc-profile.compact { align-items: center; }


/* ---- CCTV page ---- */
.cctv-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px 22px; flex-wrap: wrap; padding: 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-card); }
.cctv-bar .cctv-input-group { flex: 1 1 420px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.cctv-input-ico { position: absolute; margin-left: 14px; color: var(--text-secondary); pointer-events: none; display: grid; }
.cctv-bar #cctvCameraInput { flex: 1; min-width: 0; padding: 13px 14px 13px 44px; font-family: var(--font-body); font-size: 15.5px; text-transform: uppercase; letter-spacing: 0.04em; }
.cctv-bar .cctv-actions { display: flex; align-items: center; gap: 16px; }
.cctv-bar .cctv-status-row { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-secondary); }
.cctv-bar .cctv-status-row #cctvStatusText { color: var(--text-primary); font-weight: 600; }
.cctv-bar .cctv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 11px; cursor: pointer; font-family: var(--font-display); font-size: 15.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-primary); background: var(--bg-elevated); border: 1px solid var(--border-bright); transition: background 0.15s, border-color 0.15s; min-width: 0; }
.cctv-bar .cctv-btn:hover { background: var(--bg-hover); border-color: #55556f; }
.cctv-bar .cctv-btn.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.cctv-bar .cctv-btn.primary:hover { background: #d40000; border-color: #d40000; }
.cctv-bar .cctv-help { padding: 12px; }
.cctv-indicator { padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
#tab-cctv .cctv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 16px; }

/* ---- Admin panel (its markup is inline-styled and generated by auth.js; tuned from here) ---- */
#tab-admin { padding: 28px clamp(18px, 4vw, 48px) 56px !important; }
#tab-admin > div:first-child, #tab-admin > div { border-radius: 18px !important; border-color: var(--border) !important; box-shadow: var(--shadow-card) !important; background: var(--bg-card) !important; }
#tab-admin h2 { font-family: var(--font-display) !important; font-size: 28px !important; font-weight: 800 !important; letter-spacing: 0.02em !important; color: var(--text-primary) !important; }
#tab-admin svg[stroke="#ffa500"] { stroke: #ff6060 !important; }
#tab-admin table { font-family: var(--font-body) !important; }
#tab-admin th { font-family: var(--font-display) !important; font-size: 13px !important; letter-spacing: 0.1em !important; text-transform: uppercase; color: var(--text-muted) !important; }
#tab-admin td { font-size: 14px; }
#tab-admin tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
#tab-admin [style*="monospace"], #tab-admin code { font-family: var(--font-mono) !important; }


/* ================================================================
   REGISTERED CREDENTIALS v12: one rich card per account
   ================================================================ */
.cred-card { flex-direction: column; align-items: stretch; gap: 16px; padding: 20px; }
.cc-top { display: flex; align-items: center; gap: 16px; }
.cc-photo { flex: none; width: 58px; height: 58px; border-radius: 50%; object-fit: cover; border: 3px solid var(--bg-card); box-shadow: 0 0 0 2px #5865f2; background: var(--bg-elevated); }
.cc-photo-blank { display: grid; place-items: center; color: #ff6060; box-shadow: 0 0 0 2px rgba(230, 0, 0, 0.45); }
.cc-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cc-name { font-family: var(--font-display); font-size: 24px; font-weight: 800; line-height: 1.05; letter-spacing: 0.01em; color: var(--text-primary); overflow-wrap: anywhere; }
.cc-handle { font-size: 13.5px; color: var(--text-secondary); min-height: 1em; }
.cc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.cc-stat { display: flex; flex-direction: column; gap: 4px; padding: 13px 14px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 13px; min-width: 0; }
.cc-stat-head { display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.cc-stat-value { font-size: 16px; font-weight: 700; color: var(--text-primary); min-width: 0; }
.cc-stat-sub { font-size: 12.5px; color: var(--text-secondary); overflow-wrap: anywhere; }
.cc-stat[data-state="ok"] .cc-stat-head svg { color: #35e0a1; }
.cc-stat[data-state="warn"] .cc-stat-head svg, .cc-stat[data-state="warn"] .cc-stat-value { color: #ffc14d; }
.cc-stat[data-state="bad"] .cc-stat-head svg, .cc-stat[data-state="bad"] .cc-stat-value { color: #ff7a7a; }
.cc-bar { height: 6px; margin-top: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.cc-bar i { display: block; height: 100%; border-radius: inherit; background: #35e0a1; }
.cc-stat[data-state="warn"] .cc-bar i { background: #ffc14d; }
.cc-stat[data-state="bad"] .cc-bar i { background: #ff5a5a; }
.cc-copy { display: inline-flex; align-items: center; gap: 7px; padding: 0; border: 0; background: none; cursor: pointer; font-family: var(--font-mono); font-size: 13px; color: var(--text-primary); text-align: left; overflow-wrap: anywhere; }
.cc-copy svg { flex: none; color: var(--text-muted); }
.cc-copy:hover svg { color: var(--text-primary); }
.cc-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--accent-hot); text-decoration: none; }
.cc-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.cc-foot { display: flex; justify-content: flex-end; }


/* ---- Steam mini-profile inside the credential card ---- */
.cc-steam { grid-column: span 2; gap: 10px; }
@media (max-width: 760px) { .cc-steam { grid-column: span 1; } }
.cc-steam-body { display: flex; align-items: center; gap: 14px; }
.cc-steam-photo { flex: none; width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--bg-card); border: 2px solid var(--border-bright); }
.cc-steam-photo[data-state="online"] { border-color: #57cbde; }
.cc-steam-photo[data-state="in-game"] { border-color: #8bc53f; }
.cc-steam-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cc-steam-name { font-family: var(--font-display); font-size: 24px; font-weight: 800; line-height: 1.05; letter-spacing: 0.01em; color: var(--text-primary); overflow-wrap: anywhere; }
.cc-steam-status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-secondary); }
.cc-steam-status i { width: 8px; height: 8px; border-radius: 50%; background: #6b6b80; }
.cc-steam-status.online { color: #57cbde; } .cc-steam-status.online i { background: #57cbde; }
.cc-steam-status.ingame { color: #8bc53f; } .cc-steam-status.ingame i { background: #8bc53f; }
.cc-steam-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-tag2 { padding: 2px 9px; border-radius: 999px; font-size: 12px; color: var(--text-secondary); background: var(--bg-card); border: 1px solid var(--border); }
.cc-tag2.bad { color: #ff8a8a; background: var(--red-bg); border-color: rgba(255, 90, 90, 0.4); font-weight: 600; }
.cc-tag2.warn { color: #ffc14d; background: var(--yellow-bg); border-color: rgba(255, 193, 77, 0.35); }
.cc-steam-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--border); }
.cc-skeleton { background: linear-gradient(90deg, var(--bg-card), var(--bg-hover), var(--bg-card)); background-size: 200% 100%; }
.cc-skeleton-line { display: block; width: 160px; height: 22px; border-radius: 6px; background: var(--bg-hover); color: transparent; }
@media (prefers-reduced-motion: no-preference) { .cc-skeleton { animation: ccShimmer 1.4s linear infinite; } @keyframes ccShimmer { to { background-position: -200% 0; } } }

.cc-stat, .cc-stat * , .cc-top, .cc-foot { font-family: var(--font-body); }
.cc-copy { font-family: var(--font-mono); }
.cc-name, .cc-steam-name { font-family: var(--font-display); }


/* ================================================================
   CHAT v13: grouped messages, own-account composer, team roster
   EVENTS v13: summary strip + day-grouped timeline
   ================================================================ */
.chat-shell { display: grid; grid-template-columns: minmax(0, 1fr) 290px; height: 100%; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--border); }
.chat-top { display: flex; align-items: center; gap: 14px; padding: 16px 24px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent); }
.chat-top-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: #ff6060; background: rgba(230, 0, 0, 0.12); border: 1px solid rgba(230, 0, 0, 0.35); flex: none; }
.chat-top-text { flex: 1; min-width: 0; }
.chat-top-text h2 { margin: 0; font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; color: var(--text-primary); }
.chat-top-text p { margin: 1px 0 0; font-size: 13.5px; color: var(--text-secondary); }

.chat-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 24px 8px; display: flex; flex-direction: column; gap: 2px; }
.cm-day { display: flex; align-items: center; gap: 14px; margin: 16px 0 10px; font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.cm-day::before, .cm-day::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.cm { display: flex; gap: 12px; padding: 5px 8px; margin: 0 -8px; border-radius: 12px; transition: background 0.12s; }
.cm:hover { background: rgba(255, 255, 255, 0.03); }
.cm:not(.grouped) { margin-top: 10px; }
.cm-av { flex: none; width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--bg-card); box-shadow: 0 0 0 1px var(--border-bright); background: var(--bg-elevated); }
.cm-av-blank { display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #ff8a8a; background: rgba(230, 0, 0, 0.12); }
.cm-av-gap { visibility: hidden; border: 0; box-shadow: none; }
.cm-body { min-width: 0; flex: 1; }
.cm-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cm-name { font-size: 15px; font-weight: 700; }
.cm-name a { text-decoration: none; }
.cm-name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.cm-head time { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cm-tag { padding: 1px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; }
.cm-tag.me { color: #35e0a1; background: var(--green-bg); }
.cm-tag.web { color: #8fb8ff; background: rgba(110, 168, 255, 0.12); }
.cm-text { position: relative; font-size: 15px; line-height: 1.5; color: var(--text-primary); overflow-wrap: anywhere; }
.cm-text a { color: #8fb8ff; text-underline-offset: 3px; }
.cm-time-inline { display: none; margin-left: 10px; font-size: 11.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cm.grouped:hover .cm-time-inline { display: inline; }
.cm.mine .cm-text { color: #fff; }
.cm.fresh { animation: cmIn 0.25s var(--ease-out) both; }
@keyframes cmIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.chat-composer { padding: 12px 24px 18px; border-top: 1px solid var(--border); background: var(--bg-secondary); }
.chat-input-bar { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 8px; background: var(--bg-card); border: 1px solid var(--border-bright); border-radius: 16px; transition: border-color 0.15s, box-shadow 0.15s; }
.chat-input-bar[hidden] { display: none; }
.chat-input-bar:focus-within { border-color: var(--accent-hot); box-shadow: 0 0 0 3px rgba(230, 0, 0, 0.16); }
.chat-identity { flex: none; display: inline-flex; align-items: center; gap: 9px; padding: 5px 12px 5px 6px; border-radius: 12px; background: var(--bg-elevated); border: 1px solid var(--border); max-width: 220px; }
.chat-identity img, .ci-blank { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; }
.ci-blank { display: grid; place-items: center; color: var(--text-muted); background: var(--bg-card); }
.ci-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.ci-text small { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.ci-text b { font-size: 13.5px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-input-bar .chat-input { flex: 1; min-width: 0; padding: 11px 6px; border: 0; outline: 0; background: transparent; box-shadow: none; font-family: var(--font-body); font-size: 15.5px; color: var(--text-primary); }
.chat-input-bar .chat-input:disabled { cursor: not-allowed; opacity: 0.6; }
.chat-counter { flex: none; font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.chat-input-bar .chat-send-btn { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; cursor: pointer; color: #fff; background: var(--accent); transition: background 0.15s, transform 0.15s; }
.chat-input-bar .chat-send-btn:hover:not(:disabled) { background: #d40000; }
.chat-input-bar .chat-send-btn:active:not(:disabled) { transform: translateY(1px); }
.chat-input-bar .chat-send-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.chat-gate { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 16px; background: rgba(255, 193, 77, 0.07); border: 1px solid rgba(255, 193, 77, 0.35); }
.chat-gate[hidden] { display: none; }
.chat-gate-ico { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; color: #ffc14d; background: var(--yellow-bg); border: 1px solid rgba(255, 193, 77, 0.4); }
.chat-gate-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-gate-text strong { font-size: 15.5px; color: var(--text-primary); }
.chat-gate-text span { font-size: 13.5px; line-height: 1.45; color: var(--text-secondary); }
@media (max-width: 640px) { .chat-gate { flex-wrap: wrap; } .chat-identity .ci-text { display: none; } }

/* Team roster */
.chat-side { display: flex; flex-direction: column; min-height: 0; background: var(--bg-secondary); }
.chat-side-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 12px; font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-secondary); border-bottom: 1px solid var(--border); }
.chat-side-count { padding: 2px 10px; border-radius: 999px; font-size: 12.5px; letter-spacing: 0; color: #35e0a1; background: var(--green-bg); font-variant-numeric: tabular-nums; }
.chat-roster { list-style: none; margin: 0; padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.cr { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 12px; }
.cr:hover { background: rgba(255, 255, 255, 0.03); }
.cr-av { position: relative; flex: none; width: 40px; height: 40px; }
.cr-av img, .cr-blank { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--bg-secondary); box-shadow: 0 0 0 1px var(--border-bright); background: var(--bg-elevated); }
.cr-blank { display: grid; place-items: center; font-weight: 800; color: #ff8a8a; background: rgba(230, 0, 0, 0.12); }
.cr-dot { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--bg-secondary); background: #5c5c70; }
.cr.on .cr-dot { background: #35e0a1; }
.cr.dead .cr-dot { background: #ff5a5a; }
.cr.off { opacity: 0.55; }
.cr-info { min-width: 0; display: flex; flex-direction: column; }
.cr-info strong { font-size: 14.5px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-info span { font-size: 12.5px; color: var(--text-muted); }
.cr-empty { padding: 20px 12px; text-align: center; font-size: 13.5px; color: var(--text-muted); }
@media (max-width: 900px) { .chat-shell { grid-template-columns: 1fr; } .chat-side { display: none; } }

/* ---- Events ---- */
.ev-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.ev-summary[hidden] { display: none; }
.ev-last { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; }
.ev-last-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--bg-elevated); border: 1px solid var(--border-bright); color: var(--text-secondary); flex: none; }
.ev-last > div { display: flex; flex-direction: column; min-width: 0; }
.ev-last strong { font-size: 14px; color: var(--text-primary); }
.ev-last span:not(.ev-last-ico) { font-size: 12.5px; color: var(--text-muted); }
.ev-last.cargo .ev-last-ico { color: #5aa9ff; background: rgba(90, 169, 255, 0.10); border-color: rgba(90, 169, 255, 0.28); }
.ev-last.heli .ev-last-ico { color: #ff6b6b; background: rgba(255, 107, 107, 0.10); border-color: rgba(255, 107, 107, 0.28); }
.ev-last.chinook .ev-last-ico { color: #ffb84d; background: rgba(255, 184, 77, 0.10); border-color: rgba(255, 184, 77, 0.28); }
.ev-last.small .ev-last-ico, .ev-last.large .ev-last-ico { color: #35e0a1; background: rgba(53, 224, 161, 0.10); border-color: rgba(53, 224, 161, 0.28); }
.filter-count { margin-left: 8px; padding: 0 7px; min-width: 20px; border-radius: 999px; font-size: 11.5px; font-weight: 700; text-align: center; color: var(--text-secondary); background: rgba(255, 255, 255, 0.07); font-variant-numeric: tabular-nums; }
.filter-btn.active .filter-count { color: #fff; background: rgba(230, 0, 0, 0.5); }
.events-filter { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; background: none; border: 0; }
.ev-timeline { display: flex; flex-direction: column; gap: 8px; padding: 0; overflow: visible; }
.ev-day { margin: 14px 0 2px; font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); display: flex; align-items: center; gap: 12px; }
.ev-day::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.ev-row .event-body { flex: 1; min-width: 0; }
.ev-kind { flex: none; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--text-secondary); background: var(--bg-elevated); border: 1px solid var(--border-bright); }
.ev-kind.cargo { color: #5aa9ff; border-color: rgba(90, 169, 255, 0.35); }
.ev-kind.heli { color: #ff8a8a; border-color: rgba(255, 107, 107, 0.35); }
.ev-kind.chinook { color: #ffc14d; border-color: rgba(255, 184, 77, 0.35); }
.ev-kind.small, .ev-kind.large { color: #35e0a1; border-color: rgba(53, 224, 161, 0.35); }
@media (max-width: 560px) { .ev-kind { display: none; } }
.ux-toast.generic[data-tone="error"] { border-color: rgba(255, 90, 90, 0.5); }
.ux-toast.generic[data-tone="error"] svg { color: #ff7a7a; }
.ux-toast.generic[data-tone="ok"] { border-color: rgba(53, 224, 161, 0.45); }
.ux-toast.generic[data-tone="ok"] svg { color: #35e0a1; }


/* ================================================================
   DROPDOWNS v14: icon + title + one-line description, clear current item
   ================================================================ */
#tab-nav .dropdown-panel {
    min-width: 310px; padding: 8px; border-radius: 16px;
    background: var(--bg-card); border: 1px solid var(--border-bright); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
#tab-nav .dropdown-panel::before, #tab-nav .dropdown-panel::after { content: none !important; display: none !important; }
#tab-nav .dd-label { display: block; padding: 10px 12px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
#tab-nav .dd-label[style] { margin-top: 0 !important; }
#tab-nav .dd-item {
    width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; text-align: left;
    text-transform: none; letter-spacing: 0; font-family: var(--font-body); background: transparent; color: var(--text-primary); overflow: visible;
}
#tab-nav .dd-item::after { display: none; }
#tab-nav .dd-item:hover, #tab-nav .dd-item:focus-visible { background: var(--bg-hover); outline: none; }
#tab-nav .dd-item:focus-visible { box-shadow: inset 0 0 0 2px #ff5a5a; }
#tab-nav .dd-ico { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; color: var(--text-secondary); background: var(--bg-elevated); border: 1px solid var(--border-bright); transition: color 0.15s, background 0.15s, border-color 0.15s; }
#tab-nav .dd-item:hover .dd-ico { color: #fff; }
#tab-nav .dd-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
#tab-nav .dd-text strong { font-size: 15px; font-weight: 700; color: var(--text-primary); }
#tab-nav .dd-text small { font-size: 12.5px; font-weight: 400; color: var(--text-secondary); }
#tab-nav .dd-item.active { background: rgba(230, 0, 0, 0.10); }
#tab-nav .dd-item.active .dd-ico { color: #ff6060; background: rgba(230, 0, 0, 0.14); border-color: rgba(230, 0, 0, 0.4); }
#tab-nav .dd-caret { transition: transform 0.2s var(--ease-out); }
#tab-nav .tab-dropdown.open .dd-caret { transform: rotate(180deg); }


/* ================================================================
   CONNECTION PHASES v15: connecting / syncing / reconnecting
   The state is always spelled out in text; colour and motion only help.
   ================================================================ */
.connection-badge.pending { color: #ffc14d; background: var(--yellow-bg); border: 1px solid rgba(255, 193, 77, 0.35); }
.connection-badge.pending.syncing { color: #8fb8ff; background: rgba(110, 168, 255, 0.10); border-color: rgba(110, 168, 255, 0.35); }
.server-uptime { margin-left: 8px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-variant-numeric: tabular-nums; color: #35e0a1; background: var(--green-bg); }
.server-uptime:empty { display: none; }
.nosrv-spin { width: 54px; height: 54px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, 0.10); border-top-color: var(--accent-hot); margin-bottom: 4px; animation: glSpin 0.9s linear infinite !important; animation-duration: 0.9s !important; animation-iteration-count: infinite !important; }
.conn-steps { list-style: none; margin: 10px 0 4px; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.conn-steps li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; font-size: 14.5px; color: var(--text-muted); background: var(--bg-elevated); border: 1px solid var(--border); }
.conn-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-bright); flex: none; }
.conn-steps li.active { color: var(--text-primary); border-color: rgba(255, 193, 77, 0.45); }
.conn-steps li.active .conn-dot { background: #ffc14d; }
.conn-steps li.done { color: var(--text-secondary); }
.conn-steps li.done .conn-dot { background: #35e0a1; }

/* ===== v16: storage monitor cards ===== */
.sm-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sm-stat { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 12px; background: var(--bg-elevated); border: 1px solid var(--border); }
.sm-stat span { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.sm-stat b { font-size: 15px; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.sm-stat.warn b { color: #ff8a8a; }
.sm-bar { height: 6px; border-radius: 999px; background: var(--bg-elevated); overflow: hidden; }
.sm-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .4s var(--ease-out); }
.sm-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; max-height: 260px; overflow: auto; }
.sm-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: var(--bg-elevated); border: 1px solid var(--border); min-width: 0; }
.sm-item img { width: 28px; height: 28px; object-fit: contain; flex: none; }
.sm-item span { flex: 1; min-width: 0; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }
.sm-item b { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.sm-empty { padding: 14px; text-align: center; font-size: 13px; color: var(--text-muted); border: 1px dashed var(--border); border-radius: 12px; }
