:root {
    /* Color System */
    --bg-dark: #181A20;
    --bg-darker: #12151A;
    --bg-table: #1E2026;
    --text-primary: #ECF5FF;
    --text-secondary: #B0BEC5;
    --text-secondary-pressed: #8A9BAE;
    --accent-primary: #3AFFA3;
    --accent-primary-pressed: #29ba6d;
    --accent-secondary: #00C8FF;
    --border-color: #2B3139;
    --highlight: rgba(58, 255, 163, 0.1);
    --positive: #3AFFA3;
    --negative: #FF5E5E;
    --negative-pressed: #b34242;

    --secondary-bg-color: #2B3139;
    --secondary-text-color: #B0BEC5;
    --secondary-hover: #29ba6d;

    /* Typography System */
    /* Font Families */
    --font-body: 'Onest', 'Inter', sans-serif;
    --font-heading: 'Onest', sans-serif;

    /* Font Sizes - Desktop */
    --font-h1-desktop: 46px;
    --font-h2-desktop: 36px;
    --font-h3-desktop: 28px;
    --font-body-desktop: 16px;
    --font-small-desktop: 14px;
    --font-button-desktop: 16px;

    /* Font Sizes - Mobile */
    --font-h1-mobile: 32px;
    --font-h2-mobile: 28px;
    --font-h3-mobile: 24px;
    --font-body-mobile: 14px;
    --font-small-mobile: 12px;
    --font-button-mobile: 14px;

    /* Font Weights */
    --font-weight-bold: 700;
    --font-weight-semibold: 600;
    --font-weight-medium: 500;
    --font-weight-regular: 400;
    --font-weight-light: 300;

    /* Line Heights */
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.6;

    /* Letter Spacing */
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.5px;
    --letter-spacing-button: 0.5px;
}
.button-primary {
    font-family: var(--font-body);
    font-size: var(--font-button-desktop);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-button);
    background-color: var(--accent-primary);
    color: var(--bg-darker);
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    .button-primary:hover {
        background-color: var(--accent-primary-pressed);
        color: var(--bg-darker);
    }
}

.button-primary:focus {
    outline: none;
}

.button-primary-small {
    font-family: var(--font-body);
    font-size: var(--font-button-mobile);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-button);
    background-color: var(--accent-primary);
    color: var(--bg-darker);
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    .button-primary-small:hover {
        background-color: var(--accent-primary-pressed);
        color: var(--bg-darker);
    }
}

.button-primary-small:focus {
    outline: none;
}

.button-error {
    font-family: var(--font-body);
    font-size: var(--font-button-desktop);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-button);
    background-color: var(--negative);
    color: var(--bg-darker);
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    .button-error:hover {
        background-color: var(--negative-pressed);
        color: var(--bg-darker);
    }
}

.button-error:focus {
    outline: none;
}

.button-error-small {
    font-family: var(--font-body);
    font-size: var(--font-button-mobile);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-button);
    background-color: var(--negative);
    color: var(--bg-darker);
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    .button-error-small:hover {
        background-color: var(--negative-pressed);
        color: var(--bg-darker);
    }
}

.button-error-small:focus {
    outline: none;
}

.button-warning-small {
    font-family: var(--font-body);
    font-size: var(--font-button-mobile);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-button);
    background-color: #FFB800;
    color: var(--bg-darker);
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

@media (hover: hover) and (pointer: fine) {
    .button-warning-small:hover {
        background-color: #FF8C00;
        color: var(--bg-darker);
    }
}

.button-warning-small:focus {
    outline: none;
}

.button-close {
    background-color: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    .button-close:hover {
        background-color: var(--highlight);
        color: var(--accent-primary);
    }
}

.button-close:focus {
    outline: none;
}

.button-back {
    font-family: var(--font-body);
    font-size: var(--font-button-desktop);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-button);
    position: absolute;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    top: 20px;
    left: 20px;
    padding: 10px 16px;
    color: var(--text-primary);
    z-index: 2;
    cursor: pointer;
    transition: all 0.3s ease;
    align-items: center;
    gap: 8px;
}

@media (hover: hover) and (pointer: fine) {
    .button-back:hover {
        background-color: var(--highlight);
        color: var(--accent-primary);
        border-color: var(--accent-primary);
    }

    .button-back:hover svg path {
        stroke: var(--accent-primary);
    }
}

.button-back:focus {
    outline: none;
}

.button-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--accent-primary);
    color: var(--bg-darker);
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    .button-fab:hover {
        background-color: var(--accent-primary-pressed);
        color: var(--bg-darker);
    }
}

.button-fab:focus {
    outline: none;
}

.button-icon {
    background-color: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    .button-icon:hover {
        background-color: var(--highlight);
        color: var(--accent-primary);
    }
}

.button-icon:focus {
    outline: none;
}

.button-link {
    font-family: var(--font-body);
    font-size: var(--font-button-desktop);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-button);
    background-color: transparent;
    color: var(--accent-primary-pressed);
    border: none;
    padding: 0;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    .button-link:hover {
        color: var(--accent-primary);
        text-decoration: underline;
    }
}

.button-link:focus {
    outline: none;
}

/* button-action-small for compact action buttons */
.button-action-small {
    font-family: var(--font-body);
    font-size: var(--font-button-mobile);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-button);
    background-color: transparent;
    color: var(--accent-primary);
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    transition: color 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .button-action-small:hover {
        color: var(--accent-primary-pressed);
    }
}

.button-action-small:focus {
    outline: none;
}

/* SVG icon button */
.button-svg-icon {
    background: transparent;
    border: none;
    padding: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.button-svg-icon:focus {
    outline: none;
    fill: var(--text-secondary);
    transition: fill 0.3s ease;
}

.button-svg-icon svg {
    width: 20px;
    height: 20px;
    fill: var(--text-secondary);
    transition: fill 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    .button-svg-icon:hover svg {
        fill: var(--accent-primary);
    }
}

.sidebar .button-svg-icon.active svg {
    fill: var(--accent-primary);
}

/* SVG icon button */
.button-svg-icon-stroke {
    background: transparent;
    border: none;
    padding: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: fill 0.3s ease;
}

.button-svg-icon-stroke:focus {
    outline: none;
    stroke: var(--text-secondary);
}

.button-svg-icon-stroke svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-secondary);
}

@media (hover: hover) and (pointer: fine) {
    .button-svg-icon-stroke:hover svg {
        stroke: var(--accent-primary);
    }
}

.sidebar .button-svg-icon-stroke.active svg {
    stroke: var(--accent-primary);
}

.button-secondary {
    font-family: var(--font-body);
    font-size: var(--font-button-desktop);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-button);
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

@media (hover: hover) and (pointer: fine) {
    .button-secondary:hover {
        background-color: var(--highlight);
        border-color: var(--accent-primary);
        color: var(--accent-primary);
    }
}

.button-secondary:focus {
    outline: none;
}

.button-secondary-small {
    font-family: var(--font-body);
    font-size: var(--font-button-mobile);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-button);
    background-color: var(--secondary-bg-color);
    color: var(--secondary-text-color);
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    .button-secondary-small:hover {
        background-color: var(--secondary-hover);
        color: var(--bg-darker);
    }
}

.button-secondary-small:focus {
    outline: none;
}

.button-text-small {
    font-family: var(--font-body);
    font-size: var(--font-button-mobile);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-button);
    background-color: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    transition: color 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .button-text-small:hover {
        color: var(--accent-primary-pressed);
    }
}

.button-text-small:focus {
    outline: none;
}

.button-list-item {
    font-family: var(--font-body);
    font-size: var(--font-button-desktop);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-button);
    width: 100%;
    background-color: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 4px;
    padding: 5px 16px;
    cursor: pointer;
    transition: color 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .button-list-item:hover {
        color: var(--accent-primary-pressed);
    }
}

.button-list-item:focus {
    outline: none;
}

.button-menu-item {
    font-family: var(--font-body);
    font-size: var(--font-button-desktop);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-button);
    width: 100%;
    background-color: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 4px;
    padding: 5px 16px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.button-menu-item:focus {
    outline: none;
}

@media (hover: hover) and (pointer: fine) {
    .button-menu-item:hover {
        color: var(--accent-primary-pressed);
    }
}
.modal-content {
    color: white;
    background-color: #181A20;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.modal-header,
.modal-footer {
    border-color: #6c757d;
}

/* Dark‐mode form controls inside any .modal-content */
.modal-content .form-control {
    background-color: #181A20;
    border-color: #495057;
    color: #cdcdcd;
}

/* Placeholder text */
.modal-content .form-control::placeholder {
    color: #393939; /* lighter gray */
    opacity: 1; /* ensure full visibility */
}

/* For older WebKit browsers */
.modal-content .form-control::-webkit-input-placeholder {
    color: #393939;
}

.modal-content .form-control:-ms-input-placeholder {
    color: #393939;
}

.modal-content .form-control::-ms-input-placeholder {
    color: #393939;
}
.dyor-switch {
    /* —— CONFIGURABLE VARS —— */
    --switch-width: 30px;
    --switch-height: 15px;
    --knob-size: 13px;
    --knob-offset: 1px;
    /* ———————————————— */

    position: relative;
    display: inline-block;
    width: var(--switch-width);
    height: var(--switch-height);
}

.dyor-switch-container {
    display: inline-flex;
    align-items: center;
}

.dyor-switch-text {
    margin-right: 0.5em; /* space between text and switch */
    user-select: none;
    font-size: 0.9em;
    color: var(--text-primary);
}

.dyor-switch .dyor-switch-input {
    /* hide the native checkbox */
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
}

.dyor-switch .dyor-switch-label {
    /* the track */
    display: block;
    width: 100%;
    height: 100%;
    background-color: #6c757d;
    border-radius: calc(var(--switch-height) / 2);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dyor-switch .dyor-switch-label::before {
    /* the knob */
    content: "";
    position: absolute;
    width: var(--knob-size);
    height: var(--knob-size);
    left: var(--knob-offset);
    top: var(--knob-offset);
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

/* checked = active state */
.dyor-switch .dyor-switch-input:checked ~ .dyor-switch-label {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.dyor-switch .dyor-switch-input:checked ~ .dyor-switch-label::before {
    transform: translateX(calc(var(--switch-width) - var(--knob-size) - 2 * var(--knob-offset)));
}
.auth-error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(24, 26, 32, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.auth-error-dialog {
    background-color: var(--bg-darker, #12151A);
    border: 1px solid var(--border-color, #2B3139);
    border-radius: 12px;
    padding: 32px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.auth-error-title {
    color: var(--negative, #FF5E5E);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-error-message {
    color: var(--text-primary, #ECF5FF);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.auth-error-warning {
    background-color: rgba(255, 165, 0, 0.1);
    border: 1px solid rgba(255, 165, 0, 0.3);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.auth-error-warning > div {
    color: var(--text-primary, #ECF5FF);
    font-size: 14px;
    line-height: 1.5;
    flex: 1;
}

.auth-error-warning-link {
    color: var(--accent-primary, #3AFFA3);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s;
}

.auth-error-warning-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.auth-error-details {
    margin-bottom: 24px;
}

.auth-error-details summary {
    color: var(--text-secondary, #B0BEC5);
    font-size: 14px;
    cursor: pointer;
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    user-select: none;
    transition: background-color 0.2s;
}

.auth-error-details summary:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.auth-error-details-content {
    color: var(--text-secondary, #B0BEC5);
    font-size: 13px;
    font-family: 'Courier New', monospace;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color, #2B3139);
    border-radius: 6px;
    padding: 16px;
    margin-top: 12px;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 200px;
    overflow-y: auto;
}

.auth-error-copy-button {
    margin-top: 12px;
    padding: 8px 16px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #ECF5FF);
    border: 1px solid var(--border-color, #2B3139);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.auth-error-copy-button:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.auth-error-copy-button.copied {
    background-color: rgba(58, 255, 163, 0.2);
    border-color: var(--accent-primary, #3AFFA3);
    color: var(--accent-primary, #3AFFA3);
}

.auth-error-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.auth-error-actions button {
    padding: 12px 24px;
    font-size: 15px;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-weight: 500;
}

@media (max-width: 600px) {
    .auth-error-dialog {
        padding: 24px;
        width: 95%;
    }

    .auth-error-title {
        font-size: 20px;
    }

    .auth-error-message {
        font-size: 14px;
    }

    .auth-error-actions {
        flex-direction: column;
    }

    .auth-error-actions button {
        width: 100%;
    }
}

.slow-request-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.slow-request-modal {
    background: #1E2026;
    border-radius: 12px;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slowRequestSlideIn 0.3s ease-out;
}

@keyframes slowRequestSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slow-request-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.slow-request-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #ECF5FF;
    display: flex;
    align-items: center;
    gap: 10px;
}

.slow-request-modal-header h3::before {
    content: "⚠️";
    font-size: 24px;
}

.slow-request-modal-body {
    padding: 24px;
    color: #B8C5D6;
    line-height: 1.6;
}

.slow-request-modal-body p {
    margin: 0 0 12px 0;
}

.slow-request-modal-body p:last-child {
    margin-bottom: 0;
    color: #ECF5FF;
    font-weight: 500;
}

.slow-request-modal-actions {
    padding: 16px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.slow-request-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    outline: none;
}

.slow-request-btn-primary {
    background: #3B82F6;
    color: white;
}

.slow-request-btn-primary:hover {
    background: #2563EB;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.slow-request-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ECF5FF;
}

.slow-request-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

body {
    background-color: #181A20;
    overflow-x: hidden;
    overflow-y: hidden;
    font-family: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Close button styles */
.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
}

.close:hover,
.close:focus {
    text-decoration: none;
    cursor: pointer;
}

.modal-content {
    font-size: 14px; /* Or any size you prefer */
    background-color: #181A20;
}

.no-pointer-events {
    pointer-events: none;
}


/* --- Layout wrapper --- */
.app-wrapper {
    background-color: #181A20;
    position: relative;
    height: 100vh;
    overflow: clip;
}

/* --- Chart / main area --- */
.chart-container {
    height: 100%;
    height: 100dvh; /* 100% of the viewport height */
    margin-right: 50px; /* leave room for sidebar */
    transition: margin-right 0.3s;
    background: #181A20; /* placeholder bg */
}

.app-wrapper.open .chart-container {
    margin-right: calc(50px + var(--panel-w));
}

/* --- Sidebar (right 50px) --- */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 50px;
    background: #181A20;
    display: flex !important;
    flex-direction: column;
    z-index: 100;
    overflow: visible;
}

/* Logo container above the buttons */
.sidebar__logo {
    display: block;
    width: 50px;
    height: 50px;
    padding-left: 5px;
    padding-right: 5px;
    margin-top: -5px;
    box-sizing: border-box;
    text-align: center;
    cursor: pointer;
}

.sidebar__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar .item {
    width: 50px;
    height: 50px;
    border: none;
    background: #181A20;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    outline: none;
}

.sidebar .item + .item {
    margin-top: 4px;
}

@media (hover: hover) and (pointer: fine) {
    .sidebar .item:hover {
        background: #303030;
    }
}

/* --- Sliding panel --- */
:root {
    --panel-w: 350px;
}

.panel {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 50px;
    width: 0;
    display: flex;
    flex-direction: column;
    transition: width .3s;
    overflow: hidden;
    z-index: 99;
    background: #181A20;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.5);
}

.app-wrapper.open .panel {
    width: var(--panel-w);
}

.panel .content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel .content.entering > * {
    animation: panel-content-enter 200ms ease-out forwards;
}

.panel .content.switching > * {
    animation: panel-content-exit 150ms ease-in forwards;
}

@keyframes panel-content-enter {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes panel-content-exit {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}

@keyframes panel-content-fade-in {
    from {
        opacity: 0;
        transform: translateX(15px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes panel-content-fade-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-15px);
    }
}

.app-wrapper.open .sidebar .item.active {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Server Selector Sidebar */
.server-selector-sidebar {
    width: 100%;
    padding: 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.server-selector-sidebar:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.server-icon-wrapper {
    position: relative;
    display: inline-block;
}

.server-icon-wrapper i {
    color: #f1f1f3;
    font-size: 16px;
}

.server-status-dot-sidebar {
    position: absolute;
    bottom: -2px;
    right: -4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #808080;
    border: 1.5px solid #181A20;
}

.server-status-dot-sidebar.online {
    background-color: #10B981;
}

.server-status-dot-sidebar.slow {
    background-color: #F59E0B;
}

.server-status-dot-sidebar.offline {
    background-color: #EF4444;
}

.server-status-dot-sidebar.checking {
    background-color: #6B7280;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* --- Sidebar Collapse Toggle --- */
.sidebar-collapse-toggle {
    position: absolute;
    left: unset;
    right: 100%;
    transform: translateX(50%);
    top: unset;
    bottom: 7%;
    width: 9px;
    height: 27px;
    border: none;
    background: transparent;
    color: #848E9C;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: color 0.2s ease;
    z-index: 101;
}

.sidebar-collapse-toggle:hover {
    color: #fff;
}

.sidebar-collapse-toggle:hover .background {
    fill: #363A45;
}

.sidebar-collapse-toggle:focus {
    outline: none;
}

.sidebar-collapse-toggle svg {
    width: 9px;
    height: 27px;
}

.sidebar-collapse-toggle svg .arrow {
    transform-origin: center;
    transform: scaleX(-1);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed .sidebar-collapse-toggle svg .arrow {
    transform: scaleX(1);
}

/* --- Collapsed Sidebar State --- */
.sidebar.no-transition,
.sidebar.no-transition *,
.app-wrapper:has(.sidebar.no-transition) .chart-container {
    transition: none !important;
}

.sidebar.collapsed {
    width: 6px;
}

.sidebar.collapsed .sidebar__logo,
.sidebar.collapsed .item,
.sidebar.collapsed .server-selector-sidebar {
    display: none !important;
}

.chart-container {
    transition: margin-right 0.3s;
}

.app-wrapper:has(.sidebar.collapsed) .chart-container {
    margin-right: 6px;
}

.app-wrapper:has(.sidebar.collapsed).open .chart-container {
    margin-right: calc(6px + var(--panel-w));
}

.app-wrapper:has(.sidebar.collapsed) .panel {
    right: 6px;
}

/* ——— Responsive: mobile bottom nav + full-width panel ——— */
@media (max-width: 768px) {
    html, body {
        /* let the UA handle panning & pinch-zoom, but block other gestures (like double-tap) */
        touch-action: manipulation;
    }

    .app-wrapper {
        display: flex;
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
    }

    /* Sidebar: dock to bottom, full width, horizontal items */
    .sidebar {
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 50px;
        max-height: 50px;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        padding: 0;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 0;
    }

    .sidebar::-webkit-scrollbar {
        height: 2px;
    }

    .sidebar::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.2);
        border-radius: 2px;
    }

    .sidebar__logo {
        width: 50px;
        height: 50px;
        min-width: 50px;
        flex-shrink: 0;
        margin: 0;
        padding: 0;
    }

    .sidebar .item {
        width: 50px;
        min-width: 50px;
        height: 100%;
        margin: 0;
        flex-shrink: 0;
    }

    /* Main chart: don’t reserve right margin, reserve bottom margin */
    .chart-container {
        flex: 1;
        height: calc(100dvh - 50px);
        max-height: calc(100dvh - 50px);
        margin-right: 0;
        margin-bottom: 50px;
        transition: margin-botom 0.3s;
    }

    .app-wrapper.open .chart-container {
        margin-right: 0;
        margin-bottom: 50px;
    }

    /* Panel: slide up from bottom, full viewport width (max 100vw) */
    .panel {
        top: 0;
        bottom: 50px;
        background: #181A20;
        right: 0;
        left: 0;
        width: 100%;
        height: auto;
        transition: transform .3s ease-out, visibility .3s;
        overflow: hidden;
        transform: translateY(100%);
        visibility: hidden;
    }

    .app-wrapper.open .panel {
        transform: translateY(0);
        visibility: visible;
        width: 100%;
    }

    .panel .content {
        height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        padding-bottom: 48px;
        box-sizing: border-box;
    }

    .panel .content.entering > * {
        animation: panel-content-fade-in 200ms ease-out forwards !important;
    }

    .panel .content.switching > * {
        animation: panel-content-fade-out 150ms ease-in forwards !important;
    }

    .server-selector-sidebar {
        width: 50px;
        min-width: 50px;
        height: 100%;
        margin: 0;
        padding: 0;
        flex-shrink: 0;
        position: sticky;
        right: 0;
        background: #181A20;
    }

    .sidebar-collapse-toggle {
        position: absolute;
        left: unset;
        right: 10%;
        top: -6px;
        transform: none;
        width: 12px;
        height: 5px;
        border-radius: 3px;
    }

    .sidebar-collapse-toggle svg {
        width: 6px;
        height: 6px;
        transform: rotate(-90deg);
    }

    .sidebar.collapsed .sidebar-collapse-toggle svg {
        transform: rotate(90deg);
    }

    .sidebar.collapsed {
        width: 100%;
        height: 20px;
    }

    .sidebar.collapsed .sidebar__logo,
    .sidebar.collapsed .item,
    .sidebar.collapsed .server-selector-sidebar {
        display: none !important;
    }

    .sidebar.collapsed .sidebar-collapse-toggle {
        top: 50%;
        transform: translateY(-50%);
    }

    .app-wrapper:has(.sidebar.collapsed) .chart-container {
        margin-bottom: 20px;
    }

    .app-wrapper:has(.sidebar.collapsed) .panel {
        bottom: 20px;
        transform: translateY(100%);
    }

    .app-wrapper:has(.sidebar.collapsed).open .panel {
        transform: translateY(0);
    }
}

.tooltip-container {
    width: auto;
    height: auto; /* Adjust height automatically */
    position: absolute;
    display: none;
    padding: 8px;
    box-sizing: border-box;
    font-size: 12px;
    text-align: left;
    z-index: 1000;
    top: 12px; /* You might want to dynamically adjust this based on event coordinates */
    left: 12px; /* You might want to dynamically adjust this based on event coordinates */
    pointer-events: none;
    border-radius: 2px;
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: white;
    color: black;
    /* Light grey border */
    border: 1px solid #dbdbdb;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.18); /* Adding a subtle shadow */
}

/* Tooltip title */
.tooltip-title {
    margin-bottom: 4px;
    font-weight: bold;
    color: #304FFE; /* Blue color for title */
}

/* Generic tooltip row */
.tooltip-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

/* Generic tooltip icon */
.tooltip-icon {
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
}

/* Specific icon background colors are added through additional classes */
.tooltip-icon.balance {
    background: #304FFE; /* Blue background for balance */
}

.tooltip-icon.delta-positive {
    background: #26a69a; /* Green background for positive delta */
}

.tooltip-icon.delta-negative {
    background: #ef5350; /* Red background for negative delta */
}

/* Tooltip text next to icon */
.tooltip-text {
    flex-grow: 1;
    margin-left: 4px;
}
/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

/* Toast Message */
.toast {
    background-color: #333;
    color: white;
    padding: 16px;
    margin-top: 10px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.5s;
}

/* Success Toast */
.toast-success {
    background-color: #4CAF50;
}

/* Error Toast */
.toast-error {
    background-color: #f44336;
}

/* remove tap highlights on mobile */
* {
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
}

.settings-content-scroll {
    padding-left: 10px;
    padding-right: 10px;
    padding-top: 10px;
    flex: 1;
    overflow-y: auto;
    touch-action: pan-y;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

/* settings mode switcher container */
.settings-mode-switcher {
    display: flex;
    justify-content: stretch;
    align-items: center;
}

/* individual tab buttons */
.mode-button {
    flex: 1;
    padding: 10px;
    cursor: pointer;
    background-color: #181A20;
    color: white;
    border: none;
    outline: none;
    font-family: sans-serif;
}

.mode-button:hover {
    background-color: #22242A;
}

.mode-button.active {
    font-weight: bold;
    background: #283053;
}

.settings-mode-title {
    font-size: 14px;
    color: #ECF5FF;
    font-family: "Onest", sans-serif;
    font-weight: 400;
    margin-left: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
}

/* tab switcher container */
.settings-tab-switcher {
    display: flex;
    justify-content: stretch;
    align-items: center;
}

/* individual tab buttons */
.tab-button {
    flex: 1;
    padding: 10px;
    cursor: pointer;
    background-color: #181A20;
    color: white;
    border: none;
    outline: none;
    font-family: sans-serif;
}

.tab-button:hover {
    background-color: #22242A;
}

.tab-button.active {
    font-weight: bold;
    border-bottom: 1px solid #fff;
}

/* generic hidden/shown content sections */
.tab-content {
    display: none;
    background-color: transparent;
}

.tab-content.active {
    display: block;
}

/* form-group container spacing */
.form-group {
    margin-bottom: 5px;
    width: 100%;
    /*background: red;*/
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

/* checkbox and radio input styling */
.form-check {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: start;
    gap: 10px;
    margin-bottom: 5px;
}

.form-check-label {
    color: #fff;
    align-self: center;
    user-select: none; /* standard */
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE/Edge */
}

/* checkbox base */
.form-check-input {
    -webkit-appearance: none;
    appearance: none;
    min-width: 20px;
    width: 20px;
    height: 20px;
    border: 2px solid #6c757d;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    position: relative;
    margin-top: 0;
}

.form-check-input:checked {
    background-color: #3AFFA3;
    border-color: #3AFFA3;
}

.form-check-input:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.form-check-input:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

/* radio buttons */
.form-check-input[type="radio"] {
    min-width: 20px;
    border-radius: 50%;
}

.form-check-input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    top: 4.5px;
    left: 4px;
    width: 8px;
    height: 8px;
    background-color: #000;
    border-radius: 50%;
}

/* numeric/text inputs */
.form-control {
    font-size: 14px;
    padding: 5px 10px;
    width: 100px;
    background-color: transparent;
    border: 1px solid #374151;
    color: #FFF;
}

.form-control:focus {
    background-color: transparent;
    color: #FFF;
    caret-color: #FFF;
    border-color: #FFF;
    outline: none;
}

.form-control:disabled {
    background-color: transparent;
    color: #707070;
}

.form-control::placeholder {
    color: #707070;
}

/* section containers */
.settings-section {
    padding: 20px;
    margin: 15px 0;
    border: 1px solid #374151;
    background-color: #22242A;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: start;
}

.settings-section h3 {
    font-size: 18px;
    color: #ECF5FF;
    font-family: "Onest", sans-serif;
    font-weight: 400;
}

/* optional container for numeric inputs with label */
.minimumDollarDiv {
    padding: 10px;
    background-color: #f8f8f8;
    border-radius: 5px;
}

.current-coin-label {
    font-size: 14px;
    color: #FFF;
    margin-bottom: 5px;
}

/* modern tooltip */
.tooltip-icon {
    align-self: center;
    position: relative;
    cursor: pointer;
    margin-left: 6px; /* small gap from label */
    font-size: 1em;
    color: #6c757d; /* match your unchecked border color */
}

.tooltip-icon-symbol {
    user-select: none;
}

.tooltip-content {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    width: 250px;
    white-space: normal;
    overflow-wrap: break-word;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
    pointer-events: none;
}

.tooltip-content.visible {
    visibility: visible;
    opacity: 1;
}

/* Dropdown Field */
/* wrapper & label */
.custom-dropdown-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.custom-dropdown-label {
    margin-bottom: 4px;
    color: #fff;
    user-select: none;
}

/* trigger button */
.custom-dropdown-trigger {
    font-size: 14px;
    padding: 6px 10px;
    background-color: #181A20;
    color: #fff;
    border: 1px solid #374151;
    border-radius: 4px;
    text-align: left;
    cursor: pointer;
    position: relative;
}

.custom-dropdown-trigger::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%) rotate(90deg);
    border: solid #fff;
    border-width: 0 1px 1px 0;
    padding: 4px;
}

/* options list */
.custom-dropdown-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 200px;
    margin: 0;
    padding: 0;
    list-style: none;
    background-color: #1f1f1f;
    border: 1px solid #374151;
    border-radius: 4px;
    overflow-y: auto;
    z-index: 1000;
}

/* each option */
.custom-dropdown-list-item {
    padding: 8px 10px;
    cursor: pointer;
    color: #fff;
}

.custom-dropdown-list-item:hover {
    background-color: #333;
}

.custom-dropdown-list-item.selected {
    background-color: #444;
}

/* scrollbar inside list (WebKit) */
.custom-dropdown-list::-webkit-scrollbar {
    width: 6px;
}

.custom-dropdown-list::-webkit-scrollbar-track {
    background: #1f1f1f;
}

.custom-dropdown-list::-webkit-scrollbar-thumb {
    background-color: #555;
    border-radius: 3px;
    border: 1px solid #1f1f1f;
}

.coin-limit-range-label {
    user-select: none;
    font-size: 13px;
    color: #9e9e9e;
    margin-left: 30px;
    margin-top: -10px;
    margin-bottom: 10px;
}
.liquidations-modal {
    position: fixed; /* Ensures the modal stays on top of the page content */
    transform: none; /* Center the modal using CSS transform */
    background-color: rgba(0, 0, 0, 0.4); /* Modal background color */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Optional shadow */
    border-radius: 5px; /* Rounded corners */
    padding: 5px;
    display: none; /* Initially hidden */
    z-index: 98; /* Ensures the modal is above other elements */
    width: 130px; /* Set desired width */
    height: auto; /* Set desired height */
    max-height: 80%; /* Optional: add max-height to prevent excessive height */
    overflow-y: auto; /* Add vertical scrolling if content overflows */
    font-size: 10px;
    opacity: 0;
    transition: opacity 200ms ease;
    touch-action: none;
    user-select: none;
}

.liquidations-modal.open {
    opacity: 1;
}

.liquidations-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 6px;
    border-bottom: 1px solid #ddd;
    cursor: move;
}

.liquidations-modal-title {
    margin: 0;
    color: var(--text-primary, #ECF5FF);
}

.closeLiqs {
    /* make the button a tiny flex-box so it only grows to fit its content */
    display: inline-flex;
    align-items: center;
    justify-content: center;

    /* zero-out all spacing */
    padding: 5px;
    margin: 0;
    font-size: 1.5rem;
    line-height: 1rem;
    color: var(--text-secondary, #B0BEC5);
    background-color: transparent;
    outline: none;
    border: none;

    /* override any browser minimums */
    min-width: 0;
    min-height: 0;
}

.closeLiqs:hover {
    color: var(--text-primary, #ECF5FF);
}

.closeLiqs:focus,
.closeLiqs:active {
    outline: none;
}

.closeLiqs::-moz-focus-inner {
    border: 0;
}

.liquidations-modal-body {
    color: var(--text-primary, #ECF5FF);
    font-size: 12px;
    padding-top: 3px;
}

.liquidation-level-info {
    padding: 2px 0;
}

.liquidation-level-square {
    width: 10px;
    height: 10px;
    margin-right: 10px; /* Adjust spacing as needed */
    display: inline-block; /* Ensures squares appear side-by-side */
}

.radio-container {
    margin-top: 10px;
    column-count: 2;
    column-gap: 10px;
}

.radio-label {
    display: block; /* ensure each label stays in one column */
    break-inside: avoid;
    margin-bottom: 4px;
}

.radio-input {
    margin-right: 10px; /* Adjust the spacing as needed */
}

.liquidation-empty-state {
    padding: 6px 3px;
    text-align: center;
    color: var(--text-secondary-pressed, #8A9BAE);
}

.empty-state-message {
    color: var(--text-secondary, #B0BEC5);
    font-size: 12px;
    margin-bottom: 4px;
}

.empty-state-hint {
    color: var(--text-secondary-pressed, #8A9BAE);
    font-size: 10px;
    font-style: italic;
}

.liquidation-filter-info {
    color: var(--accent-primary, #3AFFA3);
    font-size: 10px;
    padding: 3px 0;
    margin-bottom: 2px;
    border-bottom: 1px solid rgba(58, 255, 163, 0.2);
}

.liquidation-error-state {
    padding: 8px 5px;
    text-align: center;
}

.error-state-icon {
    font-size: 20px;
    margin-bottom: 5px;
    color: #E7E60C;
}

.error-state-message {
    color: var(--text-secondary, #B0BEC5);
    font-size: 11px;
    line-height: 1.3;
    margin-bottom: 4px;
}

.error-state-hint {
    color: var(--text-secondary-pressed, #8A9BAE);
    font-size: 9px;
    font-style: italic;
    margin-bottom: 8px;
    line-height: 1.2;
}

.liquidation-retry-btn {
    padding: 4px 12px;
    font-size: 10px;
    background-color: var(--accent-primary, #3AFFA3);
    color: var(--bg-darker, #12151A);
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    outline: none;
}

.liquidation-retry-btn:hover {
    background-color: var(--secondary-hover, #29ba6d);
}

.liquidation-retry-btn:active {
    background-color: var(--accent-primary-pressed, #29ba6d);
}

.liquidation-loading-skeleton {
    padding: 15px 5px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.liquidation-loading-skeleton::before,
.liquidation-loading-skeleton::after {
    content: '';
    height: 10px;
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 3px;
}

.liquidation-loading-skeleton::before {
    width: 80%;
}

.liquidation-loading-skeleton::after {
    width: 60%;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.liquidation-update-time {
    color: var(--text-secondary-pressed, #8A9BAE);
    font-size: 9px;
    padding: 2px 0;
    margin-top: 3px;
    text-align: left;
    font-style: italic;
}
.limits-info-modal {
    position: fixed; /* Ensures the modal stays on top of the page content */
    transform: none; /* Center the modal using CSS transform */
    background-color: rgba(0, 0, 0, 0.4); /* Modal background color */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Optional shadow */
    border-radius: 5px; /* Rounded corners */
    padding: 5px;
    display: none; /* Initially hidden */
    z-index: 98; /* Ensures the modal is above other elements */
    width: auto; /* Set desired width */
    height: auto; /* Set desired height */
    max-height: 80%; /* Optional: add max-height to prevent excessive height */
    overflow-y: auto; /* Add vertical scrolling if content overflows */
    font-size: 10px;
    opacity: 0;
    transition: opacity 200ms ease;
    touch-action: none;
    user-select: none;
}

.limits-info-modal.open {
    opacity: 1;
}

.limits-info-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 6px;
    border-bottom: 1px solid #ddd;
    cursor: move;
}

.limits-info-modal-title {
    margin: 0;
    color: white;
}

.closeLimits {
    /* make the button a tiny flex-box so it only grows to fit its content */
    display: inline-flex;
    align-items: center;
    justify-content: center;

    /* zero-out all spacing */
    padding: 5px;
    margin: 0;
    font-size: 1.5rem;
    line-height: 1rem;
    color: #ccc;
    background-color: transparent;
    outline: none;
    border: none;

    /* override any browser minimums */
    min-width: 0;
    min-height: 0;
}

.closeLimits:hover {
    color: #ccc; /* Change hover color for visual feedback */
}

.closeLimits:focus,
.closeLimits:active {
    outline: none;
}

.closeLimits::-moz-focus-inner {
    border: 0;
}

.limits-info-modal-body {
    color: white;
    font-size: 11px;
    padding-top: 4px;
}

.limits-compact-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
    gap: 8px;
}

.limits-compact-label {
    color: #8A9BAE;
    font-size: 10px;
    font-weight: 500;
}

.limits-compact-value {
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 600;
    text-align: right;
}

.asks-color {
    color: #FF6B6B;
}

.bids-color {
    color: #51CF66;
}
/* System Alerts Container */
.system-alerts-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: none;
    flex-direction: column-reverse; /* Stack from bottom up */
    gap: 0;
    pointer-events: none; /* Allow clicks through container */
    padding: 0;
}


/* Individual Alert */
.system-alert {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.2);
    font-family: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto; /* Re-enable clicks on alerts */
    position: relative;
}

.system-alert.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Critical Alert Styling */
.system-alert-critical {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    color: white;
}

/* Non-Critical Alert Styling */
.system-alert-non_critical {
    background: linear-gradient(135deg, #f57c00 0%, #e65100 100%);
    color: white;
}

/* Close Button */
.system-alert-close {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
    z-index: 1;
}

.system-alert-close svg {
    width: 14px;
    height: 14px;
    color: white;
}

@media (hover: hover) and (pointer: fine) {
    .system-alert-close:hover {
        background: rgba(0, 0, 0, 0.4);
        border-color: rgba(255, 255, 255, 0.5);
        transform: translateY(-50%) scale(1.1);
    }
}

.system-alert-close:active {
    transform: translateY(-50%) scale(0.95);
}

/* Alert Icon */
.system-alert-icon {
    flex-shrink: 0;
    opacity: 0.95;
    animation: pulse 2s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.system-alert-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.95;
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* Alert Content */
.system-alert-content {
    flex: 1;
    min-width: 0;
}

/* Add padding for close button on non-critical alerts */
.system-alert-non_critical .system-alert-content {
    padding-right: 3rem;
}

.system-alert-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.375rem;
    flex-wrap: wrap;
}

.system-alert-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    flex: 1;
    min-width: 0;
}

.system-alert-date {
    font-size: 0.75rem;
    opacity: 0.85;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.system-alert-message {
    font-size: 0.875rem;
    line-height: 1.5;
    opacity: 0.95;
    word-wrap: break-word;
}

/* Responsive Design */
@media (max-width: 768px) {
    .system-alert {
        padding: 0.75rem 0.875rem;
        gap: 0.625rem;
    }

    .system-alert-icon {
        margin-top: 0.125rem;
    }

    .system-alert-icon svg {
        width: 20px;
        height: 20px;
    }

    .system-alert-header {
        gap: 0.375rem;
        margin-bottom: 0.25rem;
    }

    .system-alert-title {
        font-size: 0.8125rem;
        font-weight: 600;
        line-height: 1.3;
    }

    .system-alert-date {
        font-size: 0.6875rem;
        margin-top: 0.125rem;
    }

    .system-alert-message {
        font-size: 0.75rem;
        line-height: 1.4;
    }

    .system-alert-close {
        width: 28px;
        height: 28px;
        right: 0.75rem;
    }

    .system-alert-close svg {
        width: 12px;
        height: 12px;
    }

    .system-alert-non_critical .system-alert-content {
        padding-right: 2.5rem;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .system-alert {
        padding: 0.625rem 0.75rem;
        gap: 0.5rem;
    }

    .system-alert-icon svg {
        width: 18px;
        height: 18px;
    }

    .system-alert-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.125rem;
        margin-bottom: 0.25rem;
    }

    .system-alert-title {
        font-size: 0.75rem;
        font-weight: 600;
        line-height: 1.25;
    }

    .system-alert-date {
        font-size: 0.625rem;
        margin-top: 0;
    }

    .system-alert-message {
        font-size: 0.6875rem;
        line-height: 1.35;
    }

    .system-alert-close {
        width: 26px;
        height: 26px;
        right: 0.625rem;
    }

    .system-alert-close svg {
        width: 11px;
        height: 11px;
    }

    .system-alert-non_critical .system-alert-content {
        padding-right: 2.25rem;
    }
}


/* Critical alert has stronger visual emphasis */
.system-alert-critical .system-alert-icon {
    animation: critical-pulse 1.5s infinite;
}

@keyframes critical-pulse {
    0%, 100% {
        opacity: 0.95;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Print styles - hide alerts when printing */
@media print {
    .system-alerts-container {
        display: none !important;
    }
}

.debug-panel-scroll-wrapper {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.debug-panel-scroll-wrapper::-webkit-scrollbar {
    width: 8px;
}

.debug-panel-scroll-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.debug-panel-scroll-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.debug-panel-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.debug-panel-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.debug-panel-header h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #EAECEF;
}

.debug-panel-header p {
    margin: 0;
    font-size: 13px;
    color: #848E9C;
}

.debug-options-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.debug-option {
    width: 100%;
}

.debug-option-button {
    width: 100%;
    background: #1E2329;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid #3861FB;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.debug-option-button:hover {
    background: #2B3139;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
}

.debug-option-button:active {
    transform: translateX(2px) scale(0.98);
}

.debug-option-button:focus {
    outline: none;
}

.debug-option-button.loading {
    pointer-events: none;
    opacity: 0.7;
}

.debug-option-button.loading .debug-option-title::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.debug-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.debug-option-title {
    font-size: 15px;
    font-weight: 600;
    color: #EAECEF;
}

.debug-option-description {
    font-size: 12px;
    color: #848E9C;
    line-height: 1.5;
}

.debug-server-section {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.debug-section-header h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #848E9C;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.debug-server-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1E2329;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 16px;
}

.debug-server-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.debug-server-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.debug-server-status-dot.online {
    background: #0ECB81;
    box-shadow: 0 0 8px rgba(14, 203, 129, 0.5);
}

.debug-server-status-dot.offline {
    background: #F6465D;
    box-shadow: 0 0 8px rgba(246, 70, 93, 0.5);
}

.debug-server-status-dot.checking {
    background: #F0B90B;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.debug-server-name {
    font-size: 14px;
    font-weight: 600;
    color: #EAECEF;
}

.debug-server-latency {
    font-size: 12px;
    color: #848E9C;
}

.debug-server-change-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    color: #EAECEF;
    cursor: pointer;
    transition: all 0.2s ease;
}

.debug-server-change-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.debug-system-info {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.debug-info-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.debug-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #1E2329;
    border-radius: 6px;
}

.debug-info-label {
    font-size: 12px;
    color: #848E9C;
}

.debug-info-value {
    font-size: 12px;
    color: #EAECEF;
    font-family: monospace;
    word-break: break-all;
    text-align: right;
    max-width: 200px;
}

.debug-check-updates-btn {
    width: 100%;
    background: #2B3139;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 13px;
    color: #EAECEF;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.debug-check-updates-btn:hover {
    background: #363C45;
    border-color: rgba(255, 255, 255, 0.2);
}

.debug-check-updates-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.debug-check-updates-btn.up-to-date {
    background: rgba(14, 203, 129, 0.2);
    border-color: #0ECB81;
    color: #0ECB81;
}

.debug-check-updates-btn.update-available {
    background: rgba(56, 97, 251, 0.2);
    border-color: #3861FB;
    color: #3861FB;
    animation: pulse 1s ease-in-out infinite;
}

.debug-check-updates-btn.check-failed {
    background: rgba(246, 70, 93, 0.2);
    border-color: #F6465D;
    color: #F6465D;
}

.debug-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.debug-modal {
    background: #1E2329;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.debug-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.debug-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #EAECEF;
}

.debug-modal-close {
    background: transparent;
    border: none;
    color: #848E9C;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.debug-modal-close:hover {
    color: #EAECEF;
}

.debug-modal-body {
    padding: 16px;
    max-height: 60vh;
    overflow-y: auto;
}

.debug-server-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #2B3139;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.debug-server-option:last-child {
    margin-bottom: 0;
}

.debug-server-option:hover {
    background: #363C45;
    border-color: rgba(255, 255, 255, 0.2);
}

.debug-server-option.selected {
    border-color: #3861FB;
    background: rgba(56, 97, 251, 0.1);
}

.debug-server-option-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.debug-server-option-name {
    font-size: 14px;
    font-weight: 600;
    color: #EAECEF;
}

.debug-server-option-domain {
    font-size: 12px;
    color: #848E9C;
    font-family: monospace;
}

.debug-server-option-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.debug-server-option-latency {
    font-size: 12px;
    color: #848E9C;
}

.debug-server-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.debug-server-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #1E2329;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.debug-server-row:not(.active) {
    cursor: pointer;
}

.debug-server-row:not(.active):hover {
    background: #2B3139;
    border-color: rgba(255, 255, 255, 0.2);
}

.debug-server-row.active {
    border-color: #3861FB;
    background: rgba(56, 97, 251, 0.1);
}

.debug-server-row-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.debug-server-row-name {
    font-size: 13px;
    font-weight: 500;
    color: #EAECEF;
}

.debug-server-row-latency {
    font-size: 12px;
    color: #848E9C;
    font-family: monospace;
}

.debug-server-active-badge {
    font-size: 10px;
    font-weight: 600;
    color: #3861FB;
    background: rgba(56, 97, 251, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ws-panel-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    color: #fff;
    font-family: sans-serif;

    /* Firefox */
    scrollbar-width: thin; /* “auto” or “thin” */
    scrollbar-color: #2c2c2c #1f1f1f; /* thumb color, track color */
}

/* WebKit */
.ws-panel-container::-webkit-scrollbar {
    width: 8px;
}

.ws-panel-container::-webkit-scrollbar-track {
    background: #1f1f1f;
    border-radius: 4px;
}

.ws-panel-container::-webkit-scrollbar-thumb {
    background-color: #2c2c2c;
    border-radius: 4px;
    border: 2px solid #1f1f1f;
}

.ws-panel-container::-webkit-scrollbar-thumb:hover {
    background-color: #2c2c2c;
}

/* Title */
.ws-title {
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

/* grid of cards */
.ws-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

/* Refresh button */
.ws-refresh-button {
    background: #2c2c2c;
    border: none;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.ws-refresh-button:hover {
    background: #3d3d3d;
}

/* each card */
.ws-card {
    background: #1f1f1f;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    padding: 1rem;
}

/* header row */
.ws-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    font-weight: 500;
}

/* status dot */
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* stats list styling */
.ws-card-body dt {
    font-size: 0.85rem;
    color: #aaa;
}

.ws-card-body dd {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 400;
}

.ws-card-errors {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #333;
    margin-bottom: 1rem;
}

/* title above the list */
.ws-card-errors-title {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: #f44336; /* red tint for “Error details” */
    font-weight: 500;
}

/* the UL container */
.ws-card-errors-list {
    list-style: none;
    padding-left: 1rem; /* indent the bullets */
    margin: 0;
}

/* each LI entry */
.ws-card-error-item {
    font-size: 0.85rem;
    color: #e57373; /* lighter red */
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

/* fallback text when no errors */
.ws-card-no-errors {
    font-size: 0.9rem;
    color: #aaa;
    font-style: italic;
    margin: 0;
}

/* Overall Status Section */
.ws-overall-status {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.ws-overall-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.ws-overall-health {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ws-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.ws-summary-stat {
    text-align: center;
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Enhanced card status */
.ws-card-status {
    display: flex;
    align-items: center;
}

.quality-text {
    font-size: 0.8rem;
    margin-left: 4px;
    text-transform: capitalize;
}

/* Message types section */
.ws-message-types {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #333;
}

.ws-message-types h4 {
    font-size: 0.9rem;
    margin: 0 0 0.5rem 0;
    color: #ccc;
    font-weight: 500;
}

.ws-message-types .type-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 2px;
    line-height: 1.3;
}

.ws-message-types .type-label {
    color: #aaa;
}

.ws-message-types .type-value {
    color: #fff;
    font-weight: 500;
}
/* Container: stacked column */
.toast-container-v2 {
    position: fixed;
    top: 20px;
    right: 20px;
    left: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    overflow-y: auto;
    gap: 10px;
}

/* Base toast */
.toast-v2 {
    position: relative;
    background-color: #333;
    color: #fff;
    padding: 16px;
    height: auto;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.5s;
    overflow: hidden; /* for progress bar */
}

/* Types */
.toast-success-v2 {
    background-color: #4CAF50;
}

.toast-error-v2 {
    background-color: #f44336;
}

.toast-warning-v2 {
    background-color: #ff9800;
}

.toast-info-v2 {
    background-color: #2196f3;
}

/* Inner message */
.toast-message-v2 {
    display: block;
}

/* Progress bar */
.toast-progress-v2 {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.7);
    width: 100%;
    transition: width linear;
    /* transition-duration will be inherited from inline style duration */
}
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.dialog-overlay.visible {
    opacity: 1;
}

.dialog-container {
    background: #181A20;
    border: 1px solid #515860;
    border-radius: 12px;
    max-width: 420px;
    width: 90%;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.dialog-overlay.visible .dialog-container {
    transform: scale(1);
}

.dialog-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.dialog-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dialog-icon.warning {
    background: rgba(255, 152, 0, 0.15);
    color: #ff9800;
}

.dialog-icon.error {
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
}

.dialog-icon.info {
    background: rgba(33, 150, 243, 0.15);
    color: #2196f3;
}

.dialog-icon.success {
    background: rgba(58, 255, 163, 0.15);
    color: #3AFFA3;
}

.dialog-icon svg {
    width: 20px;
    height: 20px;
}

.dialog-title {
    font-size: 18px;
    font-weight: 600;
    color: #f8f9fa;
    margin: 0;
}

.dialog-body {
    color: #aab6c1;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 24px;
}

.dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.dialog-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.dialog-btn-primary {
    background: #3AFFA3;
    color: #181A20;
}

.dialog-btn-primary:hover {
    background: #2ee090;
}

.dialog-btn-secondary {
    background: transparent;
    border: 1px solid #515860;
    color: #f8f9fa;
}

.dialog-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #6c757d;
}

.bot-modal-content {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
}

.bot-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.bot-modal-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bot-modal-header .modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.bot-modal-help-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--bg-lighter);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.bot-modal-help-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background-color: var(--highlight);
}

.bot-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background-color: var(--bg-lighter);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.bot-modal-close:hover {
    border-color: var(--accent-error);
    color: var(--accent-error);
    background-color: rgba(239, 68, 68, 0.1);
}

.bot-modal-body {
    padding: 24px 20px;
}

.bot-form-group {
    margin-bottom: 20px;
}

.bot-form-group:last-child {
    margin-bottom: 0;
}

.bot-form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.bot-form-input {
    width: 100%;
    padding: 12px 14px;
    background-color: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bot-form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 200, 117, 0.1);
}

.bot-form-input::placeholder {
    color: #3a3f47;
}

.bot-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.bot-modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bot-modal-btn-save {
    background-color: var(--accent-primary);
    color: var(--bg-darker);
    border: none;
}

.bot-modal-btn-save:hover {
    background-color: var(--accent-primary-pressed);
}

.bot-modal-btn-delete {
    background-color: transparent;
    color: var(--accent-error);
    border: 1px solid var(--accent-error);
}

.bot-modal-btn-delete:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

/* make sure it’s on top, covers entire screen, and allows text-selection */
.copy-overlay {
    position: fixed;
    inset: 0; /* shorthand for top:0;left:0;right:0;bottom:0 */
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    padding: 1rem;
    z-index: 9999;
    /* ensure selections inside can happen */
    user-select: text !important;
    -webkit-user-select: text !important;
}

.copy-overlay-textarea {
    flex: 1;
    width: 100%;
    margin-bottom: 1rem;
    font-family: monospace;
    font-size: 0.9rem;
    /* give it a light background so selection is obvious */
    background: #fff;
    color: #000;
    border: none;
    resize: none;
    padding: 0.5rem;
    overflow: auto;
    /* ensure mobile will let you select */
    user-select: text !important;
    -webkit-user-select: text !important;
}

.copy-overlay-close {
    align-self: flex-end;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    cursor: pointer;
}
.notification-item {
    display: grid;
    grid-template-columns: auto auto 1fr auto auto;
    grid-template-rows: auto auto;
    row-gap: 16px;
    column-gap: 12px;
    align-items: center;
    width: 100%;
    background: var(--bg-table, #1E2026);
    border: 1px solid var(--border-color, #2B3139);
    border-radius: 12px;
    padding: 14px 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@media (hover: hover) {
    .notification-item:hover {
        transform: translateY(-2px);
        border-color: var(--accent-primary, #3AFFA3);
        box-shadow: 0 8px 24px rgba(58, 255, 163, 0.12);
    }
}

.notification-checkbox {
    grid-row: 1;
    grid-column: 1;
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background-color: #2B3139;
    border: 1px solid #515860;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
    position: relative;
}

.notification-checkbox:checked {
    background-color: var(--accent-primary, #3AFFA3);
    border-color: var(--accent-primary, #3AFFA3);
}

.notification-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid #181A20;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.notification-checkbox:hover {
    border-color: #6c757d;
}

.notification-checkbox:focus {
    outline: none;
}

.notification-status-dot {
    grid-row: 1;
    grid-column: 2;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #515860;
    transition: background-color 0.2s ease;
}

.notification-status-dot.active {
    background-color: var(--accent-primary, #3AFFA3);
    box-shadow: 0 0 8px rgba(58, 255, 163, 0.5);
}

.notification-title-row {
    grid-row: 1;
    grid-column: 3;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.notification-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #ECF5FF);
    word-break: break-word;
}

.notification-mark {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
    flex-shrink: 0;
}

.notification-actions {
    grid-row: 1;
    grid-column: 4;
    display: flex;
    align-items: center;
    gap: 4px;
}

.notification-actions .dyor-switch-container {
    margin-right: 8px;
}

.notification-actions .button-svg-icon {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #666;
    cursor: pointer;
    transition: all 0.15s ease;
}

.notification-actions .button-svg-icon:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #515860;
    color: var(--text-primary, #ECF5FF);
}

.notification-actions .button-svg-icon:focus {
    outline: none;
}

.notification-actions .button-svg-icon svg {
    width: 16px;
    height: 16px;
}

.notification-overflow-btn {
    display: none;
    width: 28px;
    height: 28px;
    padding: 0;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #666;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.notification-overflow-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #515860;
    color: var(--text-primary, #ECF5FF);
}

.notification-overflow-btn:focus {
    outline: none;
}

.notification-overflow-menu {
    position: fixed;
    background: #2a2e38;
    border: 1px solid #4a5568;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    z-index: 99999;
    min-width: 130px;
    padding: 4px 0;
    visibility: hidden;
    opacity: 0;
    transform: scale(0.95);
    transform-origin: top right;
    transition: visibility 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}

.notification-overflow-menu.open {
    visibility: visible;
    opacity: 1;
    transform: scale(1);
}

.notification-overflow-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    color: #c9d1d9;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.notification-overflow-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.notification-overflow-menu-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: #8b949e;
}

.notification-overflow-menu-item:hover svg {
    color: #c9d1d9;
}

.notification-secondary-row {
    grid-row: 2;
    grid-column: 3 / 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.notification-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.notification-tag {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.notification-tags-overflow {
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    background: #2B3139;
    color: #888;
}

.notification-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-secondary, #888);
    white-space: nowrap;
    flex-shrink: 0;
}

.notification-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: default;
}

.notification-meta-item i {
    font-size: 10px;
    opacity: 0.7;
}

.notification-meta-separator {
    color: #515860;
}

mark {
    background-color: #fffa91;
    padding: 0 2px;
    border-radius: 2px;
    color: #181A20;
}

.logic {
    color: #555;
    font-weight: bold;
    margin: 0 4px;
}

@media (max-width: 768px) {
    .notification-item {
        padding: 12px 12px;
        row-gap: 12px;
        column-gap: 10px;
        border-radius: 10px;
    }

    .notification-checkbox {
        width: 16px;
        height: 16px;
    }

    .notification-checkbox:checked::after {
        left: 4px;
        top: 1px;
        width: 4px;
        height: 8px;
    }

    .notification-name {
        font-size: 13px;
    }

    .notification-actions .button-svg-icon {
        width: 26px;
        height: 26px;
    }

    .notification-actions .button-svg-icon svg {
        width: 14px;
        height: 14px;
    }

    .notification-tag {
        font-size: 9px;
        padding: 2px 6px;
    }

    .notification-meta {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .notification-item {
        padding: 10px 10px;
        row-gap: 10px;
        column-gap: 8px;
    }

    .notification-actions .button-svg-icon {
        width: 24px;
        height: 24px;
    }

    .notification-actions .button-svg-icon svg {
        width: 12px;
        height: 12px;
    }
}

.panel .notification-item {
    padding: 12px 12px;
    row-gap: 12px;
    column-gap: 8px;
    border-radius: 10px;
}

.panel .notification-checkbox {
    width: 16px;
    height: 16px;
}

.panel .notification-checkbox:checked::after {
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
}

.panel .notification-status-dot {
    width: 6px;
    height: 6px;
}

.panel .notification-name {
    font-size: 12px;
}

.panel .notification-mark {
    font-size: 10px;
    padding: 1px 4px;
}

.panel .notification-actions .dyor-switch-container {
    margin-right: 4px;
}

.panel .notification-actions .button-svg-icon {
    width: 24px;
    height: 24px;
}

.panel .notification-actions .button-svg-icon svg {
    width: 12px;
    height: 12px;
}

.panel .notification-actions .button-svg-icon.action-delete,
.panel .notification-actions .button-svg-icon.action-duplicate,
.panel .notification-actions .button-svg-icon.action-logs {
    display: none;
}

.panel .notification-overflow-btn {
    display: flex;
    width: 24px;
    height: 24px;
}

.panel .notification-secondary-row {
    grid-column: 3 / 6;
}

.panel .notification-tag {
    font-size: 9px;
    padding: 2px 6px;
}

.panel .notification-meta {
    font-size: 10px;
}

.modal-content {
    background: var(--bg-dark);
}

.modal-header {
    border-bottom: 1px solid #6c757d;
    padding: 10px 15px;
    display: flex;
    align-items: center;
}

.modal-title {
    margin: 0;
}

#notificationLogsModal .modal-dialog {
    /* force it to 80% of viewport width */
    width: 80%;
    max-width: none;
}

#notificationLogsModal .modal-body {
    /* make the body scrollable */
    max-height: 70vh;
    overflow-y: auto;
    padding: 0;
}

#notificationLogsText, #sentNotificationsText {
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: #6c757d;
}

#notificationLogsModal .modal-body,
#notificationLogsModal .modal-body pre {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

#notificationLogsModal .log-entry {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 10px;
    border: 1px dashed #6c757d;
    border-radius: 5px;
    color: #b3b3b3;
}

#notificationLogsModal .log-header {
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
}

#notificationLogsModal .log-conditions {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#notificationLogsModal .log-condition {
    margin: 0;
    padding: 0;
    line-height: 1;
    display: block;
    align-items: center;
    gap: 0.5rem;
}

#notificationLogsModal .log-overall,
#notificationLogsModal .log-expression {
    margin: 0;
    padding: 0;
    font-size: 0.85rem;
}

.log-true-notification {
    color: #11ff92;
}

.log-false-notification {
    color: #ff2929;
}

.log-true-condition {
    color: #008e4c;
}

.log-false-condition {
    color: #b63535;
}

.log-entry-label {
    font-weight: bold;
    color: #cddce3;
}

.log-entry-condition-value {
    color: #e6f2f6;
}

.tabs-header {
    padding: 0;
    display: flex;
    border-bottom: 1px solid #555;
}

.tabs-header .tab {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 0.5rem 1rem;
    color: #ccc;
    cursor: pointer;
    text-align: center;
    font-weight: 500;
}

.tabs-header .tab:hover {
    background-color: var(--highlight);
    color: #fff;
}

.tabs-header .tab.active {
    color: #fff;
    border-bottom: 2px solid var(--accent-primary-pressed);
}

/* content panes */
.tabs-content .tab-pane {
    display: none;
}

.tabs-content .tab-pane.active {
    display: block;
}

.tab-pane {
    padding-left: 1rem;
    padding-right: 1rem;
}

.logs-container {
    padding-top: 16px;
    padding-bottom: 16px;
}

.nav, .nav-tabs {
    display: none !important;
}

.log-group {
    display: flex;
    flex-direction: column;
}

.log-group-children {
    display: flex;
    flex-direction: column;
}

.sent-message-condition {
    display: block;
}

@media (max-width: 768px) {
    #notificationLogsModal .modal-dialog {
        width: 100%;
        max-width: 100vw;
        margin: 0;
        height: 100%;
    }

    #notificationLogsModal .modal-content {
        height: 100%;
        border-radius: 0;
    }

    #notificationLogsModal .modal-body {
        max-height: none;
        flex: 1;
    }
}
.notification-toolbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #181A20;
    border-bottom: 1px solid #2B3139;
    position: sticky;
    top: 0;
    z-index: 10;
    flex-wrap: wrap;
}

.toolbar-spacer {
    flex: 1;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.batch-button {
    height: 28px;
    padding: 0 8px;
    background: #2B3139;
    border: none;
    border-radius: 4px;
    color: #888;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    outline: none;
}

.batch-button:hover {
    background: #3a4149;
    color: #ECF5FF;
}

.batch-button:focus {
    outline: none;
}

.batch-button-primary {
    background: var(--accent-primary, #3AFFA3);
    color: #181A20;
}

.batch-button-primary:hover {
    background: var(--accent-primary-pressed, #29ba6d);
}

.batch-button-danger {
    background: #dc3545;
    color: #fff;
}

.batch-button-danger:hover {
    background: #c82333;
}

.toolbar-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.button-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid #2B3139;
    border-radius: 4px;
    color: #888;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 12px;
}

.button-icon:hover {
    border-color: #515860;
    color: #ECF5FF;
}

.button-icon-primary {
    background: var(--accent-primary, #3AFFA3);
    border-color: var(--accent-primary, #3AFFA3);
    color: #181A20;
}

.button-icon-primary:hover {
    background: var(--accent-primary-pressed, #29ba6d);
    border-color: var(--accent-primary-pressed, #29ba6d);
    color: #181A20;
}

.filter-select {
    height: 28px;
    padding: 4px 20px 4px 6px;
    background-color: #1F2024;
    border: 1px solid #2B3139;
    border-radius: 4px;
    color: #ECF5FF;
    font-size: 12px;
    cursor: pointer;
    transition: border-color 0.15s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%278%27 height=%278%27 viewBox=%270 0 8 8%27%3E%3Cpath fill=%27%23888%27 d=%27M0 2l4 4 4-4z%27/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    box-shadow: none;
    box-sizing: border-box;
    line-height: normal;
}

.filter-select:hover {
    border-color: #515860;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary, #3AFFA3);
    box-shadow: none;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 120px;
    max-width: 200px;
    flex: 1;
}

.search-icon {
    position: absolute;
    left: 8px;
    color: #666;
    font-size: 11px;
    pointer-events: none;
}

.search-input {
    width: 100%;
    height: 28px;
    padding: 0 24px 0 26px;
    background: #1F2024;
    border: 1px solid #2B3139;
    border-radius: 4px;
    color: #ECF5FF;
    font-size: 12px;
    transition: border-color 0.15s ease;
    box-shadow: none;
    line-height: 28px;
}

.search-input::placeholder {
    color: #555;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary, #3AFFA3);
    box-shadow: none;
    background: #1F2024;
}

.search-clear {
    position: absolute;
    right: 4px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 10px;
    transition: color 0.15s ease;
}

.search-clear:hover {
    color: #ECF5FF;
}

.notifications-list {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 16px;
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(58, 255, 163, 0.3) #181A20;
}

.notifications-list::-webkit-scrollbar {
    width: 10px;
}

.notifications-list::-webkit-scrollbar-track {
    background: #181A20;
    border-radius: 10px;
}

.notifications-list::-webkit-scrollbar-thumb {
    background: rgba(58, 255, 163, 0.3);
    border-radius: 10px;
    border: 2px solid #181A20;
}

.notifications-list::-webkit-scrollbar-thumb:hover {
    background: rgba(58, 255, 163, 0.5);
}

.notifications-list::-webkit-scrollbar-thumb:active {
    background: #3AFFA3;
}

.sort-controls {
    display: flex;
    gap: 2px;
    height: 28px;
    background: #1F2024;
    border-radius: 4px;
    padding: 2px;
    align-items: center;
}

.sort-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    height: 22px;
    padding: 0 6px;
    border-radius: 3px;
    user-select: none;
    transition: background-color 0.15s ease, color 0.15s ease;
    color: #666;
    font-size: 11px;
    font-weight: 500;
}

.sort-control:hover {
    color: #ECF5FF;
    background: rgba(255, 255, 255, 0.05);
}

.sort-control.active {
    color: #ECF5FF;
    background: #2B3139;
}

.sort-control .sort-icon {
    margin-left: 2px;
    font-size: 9px;
    opacity: 0.5;
}

.sort-control .sort-icon::before {
    content: '⇅';
}

.sort-control.active .sort-icon {
    opacity: 1;
    color: var(--accent-primary, #3AFFA3);
}

.sort-control.active.asc .sort-icon::before {
    content: '↑';
}

.sort-control.active.desc .sort-icon::before {
    content: '↓';
}

.block-empty, .block-error, .block-loader {
    align-self: center;
    align-items: center;
    text-align: center;
}

.block-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.divider {
    border-top: 1px solid #515860;
    height: auto;
    margin: 10px 0;
}

.delay-text {
    font-size: 1rem;
    color: #aab6c1;
    margin: 0;
}

.form-control {
    background-color: #495057;
    color: #f8f9fa;
    border-color: #6c757d;
}

.list-background {
    width: 100%;
    flex: 1;
    min-height: 0;
    background-color: #181A20;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.page-content {
    width: 100%;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    color: white;
}

@media (max-width: 768px) {
    .notification-toolbar {
        padding: 6px 8px;
        gap: 6px;
    }

    .toolbar-spacer {
        display: none;
    }

    .toolbar-buttons {
        margin-left: auto;
    }

    .search-container {
        flex: 1;
        min-width: 100px;
        max-width: none;
    }

    .filter-select {
        flex: 1;
        height: 26px;
        padding: 3px 18px 3px 6px;
        font-size: 11px;
    }

    .search-input {
        height: 26px;
    }

    .sort-controls {
        height: 26px;
        padding: 1px;
    }

    .sort-control {
        height: 22px;
        font-size: 10px;
    }

    .button-icon {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }

    .batch-button {
        height: 26px;
        font-size: 10px;
    }

    .notifications-list {
        padding: 8px;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .notification-toolbar {
        padding: 4px 6px;
        gap: 4px;
    }

    .search-container {
        min-width: 80px;
    }

    .search-input {
        height: 24px;
        padding: 0 20px 0 22px;
        font-size: 11px;
    }

    .search-icon {
        left: 6px;
        font-size: 10px;
    }

    .filter-select {
        height: 24px;
        padding: 2px 18px 2px 6px;
        font-size: 10px;
    }

    .sort-controls {
        height: 24px;
    }

    .sort-control {
        height: 20px;
        font-size: 9px;
    }

    .button-icon {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }

    .batch-button {
        height: 24px;
        padding: 0 6px;
        font-size: 9px;
    }

    .toolbar-buttons {
        gap: 2px;
    }

    .notifications-list {
        padding: 6px;
        gap: 6px;
    }
}

.panel .notification-toolbar {
    padding: 6px 8px;
    gap: 6px;
}

.panel .search-container {
    min-width: 80px;
    max-width: 140px;
    flex: 1;
}

.panel .search-input {
    height: 26px;
    line-height: 26px;
    font-size: 11px;
}

.panel .filter-select {
    height: 26px;
    font-size: 10px;
    padding: 3px 18px 3px 4px;
}

.panel .sort-controls {
    height: 26px;
    padding: 1px;
}

.panel .sort-control {
    height: 22px;
    font-size: 9px;
    padding: 0 4px;
}

.panel .button-icon {
    width: 26px;
    height: 26px;
    font-size: 10px;
}

.panel .batch-button {
    height: 26px;
    font-size: 9px;
    padding: 0 6px;
}

.panel .toolbar-spacer {
    flex: 0;
    min-width: 0;
}

.panel .toolbar-buttons {
    gap: 2px;
}

.panel .notifications-list {
    padding: 8px;
    gap: 8px;
}
.limit-order-notification-item {
    width: 100%;
    border: 1px solid var(--highlight);
    border-radius: 4px;
    padding: 8px;
    gap: 8px;
    display: flex;
    flex-direction: column;
    max-width: 100vw;
}

.limit-order-notification-item:hover {
    background-color: var(--highlight);
}

.limit-order-notification-header-row {
    max-width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    white-space: pre-wrap;
}

.limit-order-notification-name {
    flex: auto;
}

.limit-order-notification-footer-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.limit-order-notification-actions {
    width: auto;
    align-self: start;
    flex: 1;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-content: flex-end;
}

.limit-order-notification-details {
    display: flex;
    flex-direction: column;
    align-items: start;
    font-size: 13px;
}

.limit-order-notification-info {
    display: flex;
    flex-direction: column;
    align-items: end;
    font-size: 13px;
}

@media (max-width: 500px) {
    .limit-order-notification-header-row {
        flex-direction: column;
        align-items: flex-start;
    }
}
.favorites-panel-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    padding: 1rem;
    overflow-y: auto;

    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: var(--secondary-bg-color) var(--bg-darker);
}

/* WebKit scrollbar */
.favorites-panel-container::-webkit-scrollbar {
    width: 8px;
}

.favorites-panel-container::-webkit-scrollbar-track {
    background: var(--bg-darker);
    border-radius: 4px;
}

.favorites-panel-container::-webkit-scrollbar-thumb {
    background-color: var(--secondary-bg-color);
    border-radius: 4px;
    border: 2px solid var(--bg-darker);
}

.favorites-panel-container::-webkit-scrollbar-thumb:hover {
    background-color: var(--border-color);
}

.favorites-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.favorites-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

/* Sort button */
.favorites-sort-btn {
    background-color: var(--bg-table);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
    line-height: 1;
}

@media (hover: hover) and (pointer: fine) {
    .favorites-sort-btn:hover {
        background-color: var(--secondary-bg-color);
        color: var(--text-primary);
        border-color: var(--accent-primary);
    }
}

.favorites-sort-btn:focus {
    outline: none;
}

/* Sort menu */
.favorites-sort-menu {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    min-width: 160px;
    z-index: 10001;
    overflow: hidden;
}

.favorites-sort-menu-item {
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .favorites-sort-menu-item:hover {
        background-color: var(--secondary-bg-color);
    }
}

.favorites-sort-menu-item.active {
    background-color: var(--accent-primary);
    color: var(--bg-darker);
    font-weight: 600;
}

@media (hover: hover) and (pointer: fine) {
    .favorites-sort-menu-item.active:hover {
        background-color: var(--accent-primary-pressed);
    }
}

.favorites-buttons {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.favorites-add-btn-primary,
.favorites-add-btn-secondary {
    flex: 1;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.favorites-add-btn-primary {
    background-color: var(--accent-primary);
    color: var(--bg-darker);
}

@media (hover: hover) and (pointer: fine) {
    .favorites-add-btn-primary:hover {
        background-color: var(--accent-primary-pressed);
        color: var(--bg-darker);
    }
}

.favorites-add-btn-primary:focus {
    outline: none;
}

.favorites-add-btn-secondary {
    background-color: var(--secondary-bg-color);
    color: var(--text-secondary);
}

@media (hover: hover) and (pointer: fine) {
    .favorites-add-btn-secondary:hover {
        background-color: var(--secondary-hover);
        color: var(--bg-darker);
    }
}

.favorites-add-btn-secondary:focus {
    outline: none;
}

.favorites-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 2.5rem 1.25rem;
    line-height: 1.6;
}

.favorites-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.favorite-item-wrapper {
    background-color: var(--bg-table);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.favorite-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    grid-template-rows: auto auto;
    gap: 4px 8px;
    padding: 0.75rem;
    transition: all 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .favorite-item:hover {
        background-color: var(--secondary-bg-color);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }
}

.favorite-symbol-container {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.favorite-symbol {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .favorite-symbol:hover {
        color: var(--accent-primary);
    }
}

.favorite-exchange-type {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.favorite-exchange-type.spot {
    color: var(--accent-secondary);
}

.favorite-exchange-type.futures {
    color: var(--negative);
}

.favorite-price-container {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    align-items: center;
    gap: 8px;
}

.favorite-price {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.favorite-change {
    font-size: 12px;
    font-weight: 600;
}

.favorite-change.positive {
    color: var(--positive);
}

.favorite-change.negative {
    color: var(--negative);
}

.favorite-loading {
    font-size: 14px;
    color: var(--text-secondary);
}

.favorite-remove-btn {
    grid-column: 4;
    grid-row: 1 / 3;
    background-color: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    align-self: center;
}

@media (hover: hover) and (pointer: fine) {
    .favorite-remove-btn:hover {
        background-color: var(--highlight);
        color: var(--negative);
    }
}

.favorite-remove-btn:focus {
    outline: none;
}

/* Modal styles */
.favorites-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.favorites-modal {
    background-color: var(--bg-dark);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.favorites-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.favorites-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.favorites-modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    .favorites-modal-close:hover {
        background-color: var(--highlight);
        color: var(--negative);
    }
}

.favorites-modal-close:focus {
    outline: none;
}

/* Filter tabs */
.favorites-modal-filters {
    display: flex;
    gap: 8px;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.favorites-modal-filter-btn {
    flex: 1;
    background-color: var(--bg-table);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (hover: hover) and (pointer: fine) {
    .favorites-modal-filter-btn:hover {
        background-color: var(--secondary-bg-color);
        color: var(--text-primary);
    }
}

.favorites-modal-filter-btn.active {
    background-color: var(--accent-primary);
    color: var(--bg-darker);
    border-color: var(--accent-primary);
}

.favorites-modal-filter-btn:focus {
    outline: none;
}

.favorites-modal-search {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.favorites-modal-search-input {
    width: 100%;
    background-color: var(--bg-table);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
}

.favorites-modal-search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(58, 255, 163, 0.1);
}

.favorites-modal-search-input::placeholder {
    color: var(--text-secondary);
}

.favorites-modal-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    min-height: 400px;
    max-height: 60vh;

    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: var(--secondary-bg-color) var(--bg-darker);
}

/* WebKit scrollbar for modal */
.favorites-modal-list::-webkit-scrollbar {
    width: 8px;
}

.favorites-modal-list::-webkit-scrollbar-track {
    background: var(--bg-darker);
    border-radius: 4px;
}

.favorites-modal-list::-webkit-scrollbar-thumb {
    background-color: var(--secondary-bg-color);
    border-radius: 4px;
    border: 2px solid var(--bg-darker);
}

.favorites-modal-list::-webkit-scrollbar-thumb:hover {
    background-color: var(--border-color);
}

.favorites-modal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: var(--bg-table);
    border-radius: 8px;
    transition: all 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .favorites-modal-item:hover {
        background-color: var(--secondary-bg-color);
    }
}

.favorites-modal-symbol {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.favorites-modal-symbol-desc {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.favorites-modal-item-buttons {
    display: flex;
    gap: 8px;
}

.favorites-modal-btn-spot,
.favorites-modal-btn-futures,
.favorites-modal-btn-synthetic {
    padding: 4px 10px;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
}

.favorites-modal-btn-spot {
    background-color: var(--accent-secondary);
    color: var(--bg-darker);
}

@media (hover: hover) and (pointer: fine) {
    .favorites-modal-btn-spot:hover {
        background-color: #00B8E6;
    }
}

.favorites-modal-btn-spot:focus {
    outline: none;
}

.favorites-modal-btn-futures {
    background-color: var(--negative);
    color: var(--text-primary);
}

@media (hover: hover) and (pointer: fine) {
    .favorites-modal-btn-futures:hover {
        background-color: var(--negative-pressed);
    }
}

.favorites-modal-btn-futures:focus {
    outline: none;
}

.favorites-modal-btn-synthetic {
    background-color: var(--accent-primary);
    color: var(--bg-darker);
}

@media (hover: hover) and (pointer: fine) {
    .favorites-modal-btn-synthetic:hover {
        background-color: var(--accent-primary-pressed);
    }
}

.favorites-modal-btn-synthetic:focus {
    outline: none;
}

.favorites-modal-btn-spot.added,
.favorites-modal-btn-futures.added,
.favorites-modal-btn-synthetic.added {
    background-color: var(--positive);
    color: var(--bg-darker);
    cursor: default;
    pointer-events: none;
    opacity: 0.8;
}

.favorites-modal-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

/* Expand button */
.favorite-expand-btn {
    grid-column: 1;
    grid-row: 1 / 3;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    align-self: center;
}

@media (hover: hover) and (pointer: fine) {
    .favorite-expand-btn:hover {
        background-color: var(--secondary-bg-color);
        color: var(--text-primary);
    }
}

.favorite-expand-btn.expanded {
    color: var(--accent-primary);
}

.favorite-expand-btn:focus {
    outline: none;
}

/* Expanded content */
.favorite-expanded-content {
    padding: 0.75rem 0.75rem 0.75rem 0.75rem;
    background-color: var(--bg-darker);
    border-top: 1px solid var(--border-color);
}

.favorite-expanded-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem 1rem;
    font-size: 12px;
}

.favorite-expanded-section {
    margin-top: 0.75rem;
}

.favorite-expanded-section:first-child {
    margin-top: 0.75rem;
}

.favorite-expanded-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 0.5rem 0;
}

.favorite-expanded-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.favorite-expanded-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background-color: var(--bg-table);
    border-radius: 6px;
    transition: all 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .favorite-expanded-item:hover {
        background-color: var(--secondary-bg-color);
    }
}

.favorite-expanded-item-name {
    font-size: 12px;
    color: var(--text-primary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.favorite-expanded-item-btn {
    background-color: var(--accent-primary);
    color: var(--bg-darker);
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
    .favorite-expanded-item-btn:hover {
        background-color: var(--accent-primary-pressed);
    }
}

.favorite-expanded-item-btn:focus {
    outline: none;
}

/* Timestamp styles for synthetic symbols */
.favorite-timestamp {
    font-size: 10px;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-top: 4px;
    transition: color 0.2s ease;
}

/* Stale data warning */
.favorite-timestamp.stale {
    color: var(--status-rejected);
    opacity: 1;
    font-weight: 500;
}

.changelog-panel-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    padding: 1rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--secondary-bg-color) var(--bg-darker);
}

.changelog-panel-container::-webkit-scrollbar {
    width: 8px;
}

.changelog-panel-container::-webkit-scrollbar-track {
    background: var(--bg-darker);
    border-radius: 4px;
}

.changelog-panel-container::-webkit-scrollbar-thumb {
    background-color: var(--secondary-bg-color);
    border-radius: 4px;
    border: 2px solid var(--bg-darker);
}

.changelog-panel-container::-webkit-scrollbar-thumb:hover {
    background-color: var(--border-color);
}

.changelog-section-header {
    margin-bottom: 0.75rem;
}

.changelog-section-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.changelog-system-info {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.changelog-info-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 1rem;
}

.changelog-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: var(--bg-table);
    border-radius: 8px;
}

.changelog-info-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.changelog-info-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: right;
    word-break: break-all;
    max-width: 65%;
}

.changelog-check-updates-btn {
    width: 100%;
    background-color: var(--secondary-bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

@media (hover: hover) and (pointer: fine) {
    .changelog-check-updates-btn:hover {
        background-color: var(--secondary-hover);
        border-color: var(--accent-primary);
    }
}

.changelog-check-updates-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.changelog-check-updates-btn.update-available {
    background-color: var(--accent-primary);
    color: var(--bg-darker);
    border-color: var(--accent-primary);
}

.changelog-check-updates-btn.up-to-date {
    background-color: var(--positive);
    color: var(--bg-darker);
    border-color: var(--positive);
}

.changelog-check-updates-btn.check-failed {
    background-color: var(--negative);
    color: var(--text-primary);
    border-color: var(--negative);
}

.changelog-update-note {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 6px;
    opacity: 0.7;
}

.changelog-entries-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.changelog-entries-container {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--secondary-bg-color) var(--bg-darker);
}

.changelog-entries-container::-webkit-scrollbar {
    width: 6px;
}

.changelog-entries-container::-webkit-scrollbar-track {
    background: var(--bg-darker);
    border-radius: 3px;
}

.changelog-entries-container::-webkit-scrollbar-thumb {
    background-color: var(--secondary-bg-color);
    border-radius: 3px;
}

.changelog-loading,
.changelog-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 14px;
}

.changelog-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: changelog-spin 0.8s linear infinite;
}

@keyframes changelog-spin {
    to {
        transform: rotate(360deg);
    }
}

.changelog-entry {
    background-color: var(--bg-table);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.changelog-entry.latest {
    border: 1px solid var(--accent-primary);
    box-shadow: 0 0 12px rgba(58, 255, 163, 0.1);
}

.changelog-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.changelog-version {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-primary);
}

.changelog-entry.latest .changelog-version::after {
    content: 'LATEST';
    font-size: 9px;
    font-weight: 700;
    background-color: var(--accent-primary);
    color: var(--bg-darker);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

.changelog-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.changelog-updates-section {
    margin-top: 0.5rem;
}

.changelog-updates-section.major {
    margin-bottom: 0.75rem;
}

.changelog-updates-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.changelog-updates-section.major .changelog-updates-title {
    color: var(--accent-primary);
}

.changelog-updates-section.minor .changelog-updates-title {
    color: var(--text-secondary);
}

.changelog-updates-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.changelog-updates-list li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 4px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-primary);
}

.changelog-updates-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.changelog-updates-section.major .changelog-updates-list li::before {
    background-color: var(--accent-primary);
}

.changelog-updates-section.minor .changelog-updates-list li::before {
    background-color: var(--text-secondary);
}

@media (max-width: 768px) {
    .changelog-panel-container {
        padding: 12px;
    }

    .changelog-entries-section {
        flex: none;
        min-height: auto;
    }

    .changelog-entries-container {
        flex: none;
        overflow-y: visible;
    }

    .changelog-entry {
        padding: 10px 12px;
        margin-bottom: 10px;
        border-radius: 8px;
    }

    .changelog-entry-header {
        margin-bottom: 8px;
        padding-bottom: 6px;
    }

    .changelog-version {
        font-size: 14px;
    }

    .changelog-entry.latest .changelog-version::after {
        font-size: 8px;
        padding: 2px 4px;
        margin-left: 6px;
    }

    .changelog-date {
        font-size: 11px;
    }

    .changelog-updates-title {
        font-size: 10px;
        margin-bottom: 4px;
    }

    .changelog-updates-list li {
        font-size: 12px;
        line-height: 1.4;
        padding-left: 12px;
        margin-bottom: 2px;
    }

    .changelog-updates-list li::before {
        width: 4px;
        height: 4px;
        top: 7px;
    }

    .changelog-updates-section {
        margin-top: 6px;
    }

    .changelog-updates-section.major {
        margin-bottom: 8px;
    }

    .changelog-info-row {
        padding: 6px 10px;
    }

    .changelog-info-label {
        font-size: 11px;
    }

    .changelog-info-value {
        font-size: 12px;
    }

    .changelog-section-header h3 {
        font-size: 1rem;
    }
}

.main-content {
    display: flex;
    flex-direction: column;
    height: 100dvh;
}

.trading-panel {
    position: relative;
    flex: 0 0 0;
    height: 0;
    background: var(--bg-darker);
    border-top: none;
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow: visible;
    transition: flex-basis 0.3s ease-out, height 0.3s ease-out;
    font-family: var(--font-body);
}

.trading-panel.open {
    flex: 0 0 var(--trading-panel-height);
    height: var(--trading-panel-height);
    border-top: 1px solid var(--border-color);
}

.trading-panel-resize {
    position: absolute;
    top: -4px;
    left: 0;
    right: 0;
    height: 8px;
    cursor: ns-resize;
    z-index: 101;
}

.trading-panel-resize::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 3px;
    background: var(--border-color);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.trading-panel-resize:hover::before {
    opacity: 1;
}

.trading-panel-tabs {
    display: flex;
    align-items: center;
    height: 36px;
    min-height: 36px;
    flex-shrink: 0;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
    padding: 0 12px;
    gap: 4px;
    overflow: visible;
}

.trading-panel-tab {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: var(--font-weight-medium);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
    .trading-panel-tab:hover {
        color: var(--text-primary);
        background: var(--highlight);
    }
}

.trading-panel-tab.active {
    color: var(--text-primary);
}

.trading-panel-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-primary);
}

.trading-panel-tab:focus {
    outline: none;
}

.trading-panel-tabs-spacer {
    flex: 1;
}

.trading-panel-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .trading-panel-close:hover {
        background: var(--highlight);
        color: var(--negative);
    }
}

.trading-panel-close:focus {
    outline: none;
}

.trading-panel-close svg {
    width: 16px;
    height: 16px;
}

.trading-panel-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    min-height: 0;
    background: var(--bg-darker);
}

.trading-panel-tab-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 16px;
    overflow-y: auto;
    display: none;

    scrollbar-width: thin;
    scrollbar-color: var(--secondary-bg-color) var(--bg-darker);
}

.trading-panel-tab-content::-webkit-scrollbar {
    width: 8px;
}

.trading-panel-tab-content::-webkit-scrollbar-track {
    background: var(--bg-darker);
    border-radius: 4px;
}

.trading-panel-tab-content::-webkit-scrollbar-thumb {
    background-color: var(--secondary-bg-color);
    border-radius: 4px;
    border: 2px solid var(--bg-darker);
}

.trading-panel-tab-content::-webkit-scrollbar-thumb:hover {
    background-color: var(--border-color);
}

.trading-panel-tab-content.active {
    display: block;
}

.trading-panel-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    font-size: 14px;
    gap: 12px;
}

.trading-panel-placeholder i {
    font-size: 32px;
    color: var(--accent-primary);
    opacity: 0.5;
}

.trading-panel-placeholder span {
    font-weight: var(--font-weight-medium);
}

.chart-container {
    flex: 1;
    min-height: 0;
}

body.trading-panel-resizing .chart-container,
body.trading-panel-resizing .trading-panel {
    transition: none;
}

@media (max-width: 768px) {
    .main-content {
        height: calc(100dvh - 50px);
    }

    .main-content .chart-container {
        margin-bottom: 0;
    }

    .trading-panel {
        z-index: 50;
    }

    .trading-panel-tab {
        padding: 0 12px;
        font-size: 12px;
    }
}

.exchange-selector {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
    margin-right: 8px;
}

.exchange-selector-button {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 28px;
    padding: 0 12px;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: var(--font-weight-medium);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
    .exchange-selector-button:hover {
        background: var(--highlight);
        border-color: var(--text-secondary);
    }
}

.exchange-selector-button:focus {
    outline: none;
}

.exchange-selector-button.open {
    background: var(--highlight);
    border-color: var(--accent-primary);
}

.exchange-selector-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    transition: background 0.2s ease;
}

.exchange-selector-button.status-disconnected .exchange-selector-indicator {
    background: var(--text-secondary);
}

.exchange-selector-button.status-connecting .exchange-selector-indicator {
    background: var(--warning, #F0B90B);
    animation: pulse 1s infinite;
}

.exchange-selector-button.status-connected .exchange-selector-indicator {
    background: var(--accent-primary);
}

.exchange-selector-button.status-error .exchange-selector-indicator {
    background: var(--negative);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.exchange-selector-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exchange-selector-arrow {
    width: 14px;
    height: 14px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.exchange-selector-button.open .exchange-selector-arrow {
    transform: rotate(180deg);
}

.exchange-selector-dropdown {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 0;
    min-width: 200px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s ease;
    max-height: 300px;
    overflow-y: auto;

    scrollbar-width: thin;
    scrollbar-color: var(--secondary-bg-color) var(--bg-dark);
}

.exchange-selector-dropdown::-webkit-scrollbar {
    width: 6px;
}

.exchange-selector-dropdown::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-radius: 3px;
}

.exchange-selector-dropdown::-webkit-scrollbar-thumb {
    background-color: var(--secondary-bg-color);
    border-radius: 3px;
}

.exchange-selector-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.exchange-selector-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    .exchange-selector-option:hover {
        background: var(--highlight);
    }
}

.exchange-selector-option.selected {
    background: rgba(58, 255, 163, 0.1);
    color: var(--accent-primary);
}

.exchange-selector-option:first-child {
    border-radius: 7px 7px 0 0;
}

.exchange-selector-option:last-child {
    border-radius: 0 0 7px 7px;
}

.exchange-selector-option:only-child {
    border-radius: 7px;
}

.exchange-option-name {
    flex: 1;
}

.exchange-testnet-badge {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(240, 185, 11, 0.15);
    color: #F0B90B;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    margin-left: 8px;
}

.exchange-selector-slot:empty {
    display: none;
}

@media (max-width: 768px) {
    .exchange-selector-button {
        padding: 0 8px;
        font-size: 12px;
    }

    .exchange-selector-name {
        max-width: 100px;
    }

    .exchange-selector-dropdown {
        min-width: 180px;
    }
}

.balance-tab {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.balance-tab-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
    flex-shrink: 0;
}

.balance-tab-refresh {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: var(--font-weight-medium);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.balance-tab-refresh svg {
    width: 14px;
    height: 14px;
}

@media (hover: hover) and (pointer: fine) {
    .balance-tab-refresh:hover {
        background: var(--highlight);
        border-color: var(--text-secondary);
        color: var(--text-primary);
    }
}

.balance-tab-refresh:focus {
    outline: none;
}

.balance-tab-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    user-select: none;
}

.balance-tab-filter input {
    width: 14px;
    height: 14px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.balance-tab-filter span {
    transition: color 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .balance-tab-filter:hover span {
        color: var(--text-primary);
    }
}

.balance-tab-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;

    scrollbar-width: thin;
    scrollbar-color: var(--secondary-bg-color) var(--bg-darker);
}

.balance-tab-content::-webkit-scrollbar {
    width: 6px;
}

.balance-tab-content::-webkit-scrollbar-track {
    background: var(--bg-darker);
    border-radius: 3px;
}

.balance-tab-content::-webkit-scrollbar-thumb {
    background-color: var(--secondary-bg-color);
    border-radius: 3px;
}

.balance-table-wrapper {
    overflow-x: auto;
}

.balance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.balance-table th {
    text-align: left;
    padding: 8px 12px;
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-darker);
}

.balance-table th:not(:first-child) {
    text-align: right;
}

.balance-table td {
    padding: 10px 12px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.balance-table tbody tr {
    transition: background 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    .balance-table tbody tr:hover {
        background: var(--highlight);
    }
}

.balance-asset {
    font-weight: var(--font-weight-medium);
}

.balance-number {
    text-align: right;
    font-family: var(--font-mono, monospace);
    font-size: 12px;
}

.balance-total {
    color: var(--accent-primary);
    font-weight: var(--font-weight-medium);
}

.balance-loading,
.balance-empty,
.balance-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 120px;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 13px;
}

.balance-loading svg,
.balance-empty svg,
.balance-error svg {
    width: 32px;
    height: 32px;
    opacity: 0.5;
}

.balance-error svg {
    color: var(--negative);
    opacity: 0.7;
}

.balance-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: balance-spin 0.8s linear infinite;
}

@keyframes balance-spin {
    to {
        transform: rotate(360deg);
    }
}

.balance-retry {
    margin-top: 4px;
    padding: 6px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: var(--font-weight-medium);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .balance-retry:hover {
        background: var(--highlight);
        border-color: var(--accent-primary);
    }
}

.balance-retry:focus {
    outline: none;
}

@media (max-width: 768px) {
    .balance-tab-header {
        gap: 12px;
    }

    .balance-tab-refresh {
        padding: 0 8px;
    }

    .balance-tab-refresh span {
        display: none;
    }

    .balance-table {
        font-size: 12px;
    }

    .balance-table th,
    .balance-table td {
        padding: 8px;
    }
}

.confirm-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.confirm-dialog-overlay.visible {
    opacity: 1;
}

.confirm-dialog {
    background: var(--bg-darker, #0d0e14);
    border: 1px solid var(--border-color, #2a2e39);
    border-radius: 12px;
    min-width: 320px;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.confirm-dialog-overlay.visible .confirm-dialog {
    transform: scale(1);
}

.confirm-dialog-header {
    padding: 16px 20px;
    font-size: 15px;
    font-weight: var(--font-weight-semibold, 600);
    color: var(--text-primary, #d1d4dc);
    border-bottom: 1px solid var(--border-color, #2a2e39);
}

.confirm-dialog-body {
    padding: 20px;
    font-size: 14px;
    color: var(--text-secondary, #787b86);
    line-height: 1.5;
}

.confirm-dialog-footer {
    padding: 16px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--border-color, #2a2e39);
}

.confirm-dialog-btn {
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: var(--font-weight-medium, 500);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
}

.confirm-btn-cancel {
    background: var(--bg-dark, #1e222d);
    color: var(--text-secondary, #787b86);
    border: 1px solid var(--border-color, #2a2e39);
}

.confirm-btn-cancel:hover {
    background: var(--highlight, #2a2e39);
    color: var(--text-primary, #d1d4dc);
}

.confirm-btn-primary {
    background: var(--accent-primary, #00c853);
    color: var(--bg-darker, #0d0e14);
}

.confirm-btn-primary:hover {
    filter: brightness(1.1);
}

.confirm-btn-danger {
    background: var(--negative, #ff5252);
    color: var(--bg-darker, #0d0e14);
}

.confirm-btn-danger:hover {
    filter: brightness(1.1);
}

.confirm-dialog-btn:focus {
    outline: none;
}

.orders-tab {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.orders-tab-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
    flex-shrink: 0;
}

.orders-tab-toggle {
    display: flex;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.orders-toggle-btn {
    padding: 6px 14px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: var(--font-weight-medium);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.orders-toggle-btn:first-child {
    border-right: 1px solid var(--border-color);
}

.orders-toggle-btn.active {
    background: var(--accent-primary);
    color: var(--bg-darker);
}

@media (hover: hover) and (pointer: fine) {
    .orders-toggle-btn:not(.active):hover {
        background: var(--highlight);
        color: var(--text-primary);
    }
}

.orders-toggle-btn:focus {
    outline: none;
}

.orders-tab-refresh {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: var(--font-weight-medium);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.orders-tab-refresh svg {
    width: 14px;
    height: 14px;
}

@media (hover: hover) and (pointer: fine) {
    .orders-tab-refresh:hover {
        background: var(--highlight);
        border-color: var(--text-secondary);
        color: var(--text-primary);
    }
}

.orders-tab-refresh:focus {
    outline: none;
}

.orders-tab-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;

    scrollbar-width: thin;
    scrollbar-color: var(--secondary-bg-color) var(--bg-darker);
}

.orders-tab-content::-webkit-scrollbar {
    width: 6px;
}

.orders-tab-content::-webkit-scrollbar-track {
    background: var(--bg-darker);
    border-radius: 3px;
}

.orders-tab-content::-webkit-scrollbar-thumb {
    background-color: var(--secondary-bg-color);
    border-radius: 3px;
}

.orders-table-wrapper {
    overflow-x: auto;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.orders-table th {
    text-align: left;
    padding: 8px 12px;
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-darker);
    white-space: nowrap;
}

.orders-table td {
    padding: 10px 12px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.orders-table tbody tr {
    transition: background 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    .orders-table tbody tr:hover {
        background: var(--highlight);
    }
}

.order-symbol {
    font-weight: var(--font-weight-medium);
}

.order-side {
    font-weight: var(--font-weight-medium);
}

.order-side-buy {
    color: var(--accent-primary);
}

.order-side-sell {
    color: var(--negative);
}

.order-type {
    color: var(--text-secondary);
    font-size: 12px;
}

.order-price,
.order-qty,
.order-filled {
    font-family: var(--font-mono, monospace);
    font-size: 12px;
}

.order-time {
    color: var(--text-secondary);
    font-size: 12px;
}

.order-actions {
    text-align: center;
}

.orders-cancel-btn {
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--negative);
    border-radius: 4px;
    color: var(--negative);
    font-size: 11px;
    font-weight: var(--font-weight-medium);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 60px;
}

@media (hover: hover) and (pointer: fine) {
    .orders-cancel-btn:hover:not(:disabled) {
        background: var(--negative);
        color: var(--bg-darker);
    }
}

.orders-cancel-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.orders-cancel-btn.cancelling {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

.order-status {
    text-align: center;
}

.order-status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.order-status-badge.status-filled {
    background: rgba(0, 200, 83, 0.15);
    color: var(--accent-primary);
}

.order-status-badge.status-canceled {
    background: rgba(128, 128, 128, 0.15);
    color: var(--text-secondary);
}

.order-status-badge.status-other {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.orders-cancel-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid var(--text-secondary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: orders-spin 0.8s linear infinite;
    vertical-align: middle;
}

.orders-loading,
.orders-empty,
.orders-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 120px;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 13px;
}

.orders-loading svg,
.orders-empty svg,
.orders-error svg {
    width: 32px;
    height: 32px;
    opacity: 0.5;
}

.orders-error svg {
    color: var(--negative);
    opacity: 0.7;
}

.orders-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: orders-spin 0.8s linear infinite;
}

@keyframes orders-spin {
    to {
        transform: rotate(360deg);
    }
}

.orders-retry {
    margin-top: 4px;
    padding: 6px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: var(--font-weight-medium);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .orders-retry:hover {
        background: var(--highlight);
        border-color: var(--accent-primary);
    }
}

.orders-retry:focus {
    outline: none;
}

@media (max-width: 768px) {
    .orders-tab-header {
        gap: 12px;
    }

    .orders-toggle-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    .orders-tab-refresh {
        padding: 0 8px;
    }

    .orders-tab-refresh span {
        display: none;
    }

    .orders-table {
        font-size: 12px;
    }

    .orders-table th,
    .orders-table td {
        padding: 8px 6px;
    }

    .orders-cancel-btn {
        padding: 4px 8px;
        min-width: 50px;
    }

    .order-status-badge {
        padding: 2px 6px;
        font-size: 9px;
    }
}

.positions-tab {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.positions-tab-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
    flex-shrink: 0;
}

.positions-tab-refresh {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: var(--font-weight-medium);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.positions-tab-refresh svg {
    width: 14px;
    height: 14px;
}

@media (hover: hover) and (pointer: fine) {
    .positions-tab-refresh:hover {
        background: var(--highlight);
        border-color: var(--text-secondary);
        color: var(--text-primary);
    }
}

.positions-tab-refresh:focus {
    outline: none;
}

.positions-tab-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;

    scrollbar-width: thin;
    scrollbar-color: var(--secondary-bg-color) var(--bg-darker);
}

.positions-tab-content::-webkit-scrollbar {
    width: 6px;
}

.positions-tab-content::-webkit-scrollbar-track {
    background: var(--bg-darker);
    border-radius: 3px;
}

.positions-tab-content::-webkit-scrollbar-thumb {
    background-color: var(--secondary-bg-color);
    border-radius: 3px;
}

.positions-table-wrapper {
    overflow-x: auto;
}

.positions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.positions-table th {
    text-align: left;
    padding: 8px 12px;
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-darker);
    white-space: nowrap;
}

.positions-table td {
    padding: 10px 12px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.positions-table tbody tr {
    transition: background 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    .positions-table tbody tr:hover {
        background: var(--highlight);
    }
}

.position-symbol {
    font-weight: var(--font-weight-medium);
}

.position-side {
    font-weight: var(--font-weight-medium);
}

.position-side-long {
    color: var(--accent-primary);
}

.position-side-short {
    color: var(--negative);
}

.position-size,
.position-entry,
.position-leverage {
    font-family: var(--font-mono, monospace);
    font-size: 12px;
}

.position-pnl {
    font-family: var(--font-mono, monospace);
    font-size: 12px;
    font-weight: var(--font-weight-medium);
}

.position-pnl-positive {
    color: var(--accent-primary);
}

.position-pnl-negative {
    color: var(--negative);
}

.position-actions {
    text-align: center;
}

.positions-close-btn {
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--negative);
    border-radius: 4px;
    color: var(--negative);
    font-size: 11px;
    font-weight: var(--font-weight-medium);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 60px;
}

@media (hover: hover) and (pointer: fine) {
    .positions-close-btn:hover:not(:disabled) {
        background: var(--negative);
        color: var(--bg-darker);
    }
}

.positions-close-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.positions-close-btn.closing {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

.positions-close-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid var(--text-secondary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: positions-spin 0.8s linear infinite;
    vertical-align: middle;
}

.positions-loading,
.positions-empty,
.positions-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 120px;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 13px;
}

.positions-loading svg,
.positions-empty svg,
.positions-error svg {
    width: 32px;
    height: 32px;
    opacity: 0.5;
}

.positions-error svg {
    color: var(--negative);
    opacity: 0.7;
}

.positions-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: positions-spin 0.8s linear infinite;
}

@keyframes positions-spin {
    to {
        transform: rotate(360deg);
    }
}

.positions-retry {
    margin-top: 4px;
    padding: 6px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: var(--font-weight-medium);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .positions-retry:hover {
        background: var(--highlight);
        border-color: var(--accent-primary);
    }
}

.positions-retry:focus {
    outline: none;
}

@media (max-width: 768px) {
    .positions-tab-header {
        gap: 12px;
    }

    .positions-tab-refresh {
        padding: 0 8px;
    }

    .positions-tab-refresh span {
        display: none;
    }

    .positions-table {
        font-size: 12px;
    }

    .positions-table th,
    .positions-table td {
        padding: 8px 6px;
    }

    .positions-close-btn {
        padding: 4px 8px;
        min-width: 50px;
    }
}

.trade-tab {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0 4px;
}

.trade-tab-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--secondary-bg-color) var(--bg-darker);
}

.trade-tab-content::-webkit-scrollbar {
    width: 6px;
}

.trade-tab-content::-webkit-scrollbar-track {
    background: var(--bg-darker);
    border-radius: 3px;
}

.trade-tab-content::-webkit-scrollbar-thumb {
    background-color: var(--secondary-bg-color);
    border-radius: 3px;
}

.trade-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.trade-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.trade-label {
    font-size: 11px;
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trade-symbol-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.trade-symbol-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.trade-symbol-checkbox input {
    width: 14px;
    height: 14px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.trade-symbol-checkbox:hover {
    color: var(--text-primary);
}

.trade-symbol-input {
    flex: 1;
    height: 32px;
    padding: 0 10px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.trade-symbol-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.trade-symbol-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.trade-symbol-display {
    flex: 1;
    height: 32px;
    padding: 0 10px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: var(--font-weight-medium);
    display: flex;
    align-items: center;
}

.trade-symbol-dropdown-wrapper {
    position: relative;
    flex: 1;
}

.trade-symbol-dropdown-wrapper .trade-symbol-input {
    width: 100%;
}

.trade-symbol-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    z-index: 100;
    scrollbar-width: thin;
    scrollbar-color: var(--secondary-bg-color) var(--bg-darker);
}

.trade-symbol-dropdown::-webkit-scrollbar {
    width: 6px;
}

.trade-symbol-dropdown::-webkit-scrollbar-track {
    background: var(--bg-darker);
    border-radius: 3px;
}

.trade-symbol-dropdown::-webkit-scrollbar-thumb {
    background-color: var(--secondary-bg-color);
    border-radius: 3px;
}

.trade-symbol-dropdown-item {
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    .trade-symbol-dropdown-item:hover {
        background: var(--highlight);
    }
}

.trade-symbol-dropdown-item.selected {
    background: var(--highlight);
    color: var(--accent-primary);
}

.trade-side-toggle {
    display: flex;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.trade-side-btn {
    flex: 1;
    padding: 10px 16px;
    background: var(--bg-dark);
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: var(--font-weight-medium);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.trade-side-btn:first-child {
    border-right: 1px solid var(--border-color);
}

.trade-side-btn.buy.active {
    background: var(--accent-primary);
    color: var(--bg-darker);
}

.trade-side-btn.sell.active {
    background: var(--negative);
    color: var(--bg-darker);
}

@media (hover: hover) and (pointer: fine) {
    .trade-side-btn:not(.active):hover {
        background: var(--highlight);
        color: var(--text-primary);
    }
}

.trade-side-btn:focus {
    outline: none;
}

.trade-type-toggle {
    display: flex;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.trade-type-btn {
    flex: 1;
    padding: 8px 8px;
    background: transparent;
    border: none;
    border-right: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: var(--font-weight-medium);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.trade-type-btn:last-child {
    border-right: none;
}

.trade-type-btn.active {
    background: var(--accent-primary);
    color: var(--bg-darker);
}

@media (hover: hover) and (pointer: fine) {
    .trade-type-btn:not(.active):hover {
        background: var(--highlight);
        color: var(--text-primary);
    }
}

.trade-type-btn:focus {
    outline: none;
}

.trade-input-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.trade-input {
    flex: 1;
    min-width: 0;
    height: 36px;
    padding: 0 10px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-mono, monospace);
    transition: border-color 0.2s ease;
}

.trade-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.trade-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.trade-input-btn {
    flex-shrink: 0;
    padding: 4px 8px;
    background: var(--highlight);
    border: none;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: var(--font-weight-medium);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .trade-input-btn:hover {
        background: var(--accent-primary);
        color: var(--bg-darker);
    }
}

.trade-input-btn:focus {
    outline: none;
}

.trade-quantity-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trade-quantity-input {
    height: 36px;
    padding: 0 10px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-mono, monospace);
    transition: border-color 0.2s ease;
    width: 100%;
}

.trade-quantity-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.trade-quantity-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.trade-quantity-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.trade-quick-btns {
    display: flex;
    gap: 4px;
}

.trade-quick-btn {
    padding: 4px 8px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: var(--font-weight-medium);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .trade-quick-btn:hover {
        background: var(--highlight);
        border-color: var(--text-secondary);
        color: var(--text-primary);
    }
}

.trade-quick-btn:focus {
    outline: none;
}

.trade-available {
    font-size: 11px;
    color: var(--text-secondary);
}

.trade-available-value {
    color: var(--text-primary);
    font-family: var(--font-mono, monospace);
}

.trade-reduce-only {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.trade-reduce-only-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.trade-reduce-only-checkbox input {
    width: 14px;
    height: 14px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.trade-reduce-only-checkbox:hover {
    color: var(--text-primary);
}

.trade-summary {
    padding: 10px 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

.trade-summary-text {
    color: var(--text-primary);
}

.trade-submit-btn {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.trade-submit-btn.buy {
    background: var(--accent-primary);
    color: var(--bg-darker);
}

.trade-submit-btn.sell {
    background: var(--negative);
    color: var(--bg-darker);
}

@media (hover: hover) and (pointer: fine) {
    .trade-submit-btn.buy:not(:disabled):hover {
        filter: brightness(1.1);
    }

    .trade-submit-btn.sell:not(:disabled):hover {
        filter: brightness(1.1);
    }
}

.trade-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.trade-submit-btn:focus {
    outline: none;
}

.trade-submit-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: trade-spin 0.8s linear infinite;
}

@keyframes trade-spin {
    to {
        transform: rotate(360deg);
    }
}

.trade-error {
    padding: 8px 12px;
    background: rgba(255, 82, 82, 0.1);
    border: 1px solid var(--negative);
    border-radius: 6px;
    color: var(--negative);
    font-size: 12px;
    text-align: center;
}

.trade-success {
    padding: 8px 12px;
    background: rgba(0, 200, 83, 0.1);
    border: 1px solid var(--accent-primary);
    border-radius: 6px;
    color: var(--accent-primary);
    font-size: 12px;
    text-align: center;
}

.trade-validation-hint {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    opacity: 0.8;
}

.trade-no-exchange,
.trade-not-connected {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 120px;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 13px;
}

.trade-no-exchange svg,
.trade-not-connected svg {
    width: 32px;
    height: 32px;
    opacity: 0.5;
}

.trade-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

@media (max-width: 768px) {
    .trade-tab {
        padding: 0;
    }

    .trade-side-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .trade-type-btn {
        padding: 6px 4px;
        font-size: 10px;
    }

    .trade-input,
    .trade-quantity-input {
        height: 32px;
        font-size: 12px;
    }

    .trade-quick-btn {
        padding: 3px 6px;
        font-size: 10px;
    }

    .trade-submit-btn {
        padding: 10px 12px;
        font-size: 13px;
    }
}


/*# sourceMappingURL=workspace.404e6794.css.map*/