/* ==================== RESET ==================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'DM Mono', monospace;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
}

/* ==================== APP LAYOUT ==================== */

.app-root {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
}

/* ==================== HEADER ==================== */

.header {
    flex-shrink: 0;
    height: 56px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    gap: 16px;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.logo {
    font-weight: 700;
    font-size: 18px;
    color: var(--accent-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.logo-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.logo-wordmark {
    display: inline;
    margin-left: 8px;
    font-size: 16px;
    font-weight: 700;
}

.header-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.hc-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.hc-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hc-sep {
    width: 1px;
    height: 24px;
    background: var(--border-secondary);
    opacity: 0.5;
}

.header-select {
    padding: 6px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-secondary);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s;
    font-weight: 500;
}

.header-select:hover {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
}

.header-select:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.header-right {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.hright-sep {
    width: 1px;
    height: 32px;
    background: var(--border-secondary);
    opacity: 0.5;
}

.header-btn {
    padding: 6px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-secondary);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
}

.header-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    font-weight: 600;
}

.header-btn--icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-btn--user {
    flex-shrink: 0;
}

.header-btn--accent {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.header-btn--accent:hover {
    background: var(--accent-primary);
    color: white;
}

.listings-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #f6465d;
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

/* ==================== TICKER ==================== */

.ticker-container {
    flex-shrink: 0;
    height: 40px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    overflow: hidden;
    z-index: 50;
}

.ticker {
    height: 100%;
    overflow: hidden;
}

.ticker-content {
    display: flex;
    gap: 24px;
    padding: 0 16px;
    align-items: center;
    height: 100%;
    animation: ticker-scroll 40s linear infinite;
}

.ticker-item {
    display: flex;
    gap: 8px;
    align-items: center;
    white-space: nowrap;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.2s;
}

.ticker-item:hover {
    background: var(--bg-primary);
}

.ticker-symbol {
    font-weight: 700;
    color: var(--accent-primary);
}

.ticker-price {
    min-width: 80px;
    color: var(--text-primary);
}

.ticker-change {
    min-width: 60px;
    font-weight: 600;
}

.ticker-change.positive {
    color: #0ecb81;
}

.ticker-change.negative {
    color: #f6465d;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ==================== MAIN LAYOUT ==================== */

.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 0;
    position: relative;
}

.show-sidebar-btn {
    position: absolute;
    left: 0;
    top: 60px;
    width: 32px;
    height: 32px;
    padding: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    color: var(--text-primary);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 15;
    transition: all 0.2s;
    font-size: 14px;
}

.show-sidebar-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
}

/* ==================== SIDEBAR ==================== */

.sidebar {
    flex-shrink: 0;
    width: 280px;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10;
    transition: all 0.3s ease;
}

.sidebar.compact {
    width: 180px;
}

.sidebar-header {
    flex-shrink: 0;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-primary);
}

.sidebar-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.sidebar-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.sidebar-header-actions {
    display: flex;
    gap: 4px;
}

.sidebar-icon-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 12px;
}

.sidebar-icon-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.group-markers-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-secondary);
}

.group-marker {
    padding: 4px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.group-marker:hover {
    background: var(--bg-elevated);
    border-color: var(--border-primary);
}

.group-marker.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    font-weight: 600;
}

.group-count {
    font-size: 10px;
    opacity: 0.8;
}

.sidebar-search-bar {
    flex-shrink: 0;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-primary);
}

.search-bar {
    flex-shrink: 0;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-primary);
}

.search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 10px;
    color: var(--text-secondary);
    pointer-events: none;
}

.search-input,
.form-input {
    width: 100%;
    padding: 8px 10px 8px 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    margin: 0;
    transition: all 0.2s;
}

.search-input:focus,
.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-elevated);
}

.search-input::placeholder,
.form-input::placeholder {
    color: var(--text-secondary);
}

.sort-select-wrapper {
    flex-shrink: 0;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-primary);
}

.form-select {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.form-select:hover {
    border-color: var(--border-primary);
}

.form-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.coins-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.coin-table-header {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr auto;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-secondary);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 1;
}

.cth-symbol,
.cth-price,
.cth-change {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 3px;
    transition: background 0.2s;
}

.cth-symbol:hover,
.cth-price:hover,
.cth-change:hover {
    background: var(--bg-primary);
}

.sort-arrow {
    font-size: 10px;
    opacity: 0.6;
}

.coin-table-body {
    display: flex;
    flex-direction: column;
}

.coin-table-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr auto;
    gap: 8px;
    padding: 8px 12px;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    align-items: center;
}

.coin-table-row:hover {
    background: var(--bg-secondary);
}

.coin-table-row.active {
    background: var(--bg-elevated);
    border-left-color: var(--accent-primary);
}

.ctr-symbol {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ctr-name {
    font-weight: 600;
    color: var(--accent-primary);
}

.ctr-flags {
    display: flex;
    gap: 4px;
}

.group-flag {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    cursor: pointer;
    opacity: 0.8;
    transition: all 0.2s;
}

.group-flag:hover {
    opacity: 1;
    transform: scale(1.1);
}

.ctr-price {
    text-align: right;
    font-weight: 600;
    color: var(--text-primary);
}

.ctr-change {
    text-align: right;
    font-weight: 600;
}

.ctr-change.positive {
    color: #0ecb81;
}

.ctr-change.negative {
    color: #f6465d;
}

.ctr-actions {
    display: flex;
    justify-content: center;
}

.ctr-group-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: 3px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ctr-group-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* ==================== MAIN CONTENT ==================== */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* ==================== CHART HEADER ==================== */

.chart-header-bar {
    flex-shrink: 0;
    height: 48px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    gap: 16px;
}

.chb-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.chb-symbol-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border-secondary);
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    color: var(--accent-primary);
    font-size: 15px;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.chb-symbol-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
}

.chb-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 140px;
}

.chb-change {
    font-size: 16px;
    font-weight: 700;
    min-width: 100px;
}

.chb-change.positive {
    color: #0ecb81;
}

.chb-change.negative {
    color: #f6465d;
}

.chb-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.chb-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-secondary);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
}

.chb-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
    color: var(--accent-primary);
}

/* ==================== CHART CONTAINER ==================== */

.chart-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.chart-canvas-zone {
    flex: 1;
    position: relative;
    overflow: hidden;
    border-top: 1px solid var(--border-secondary);
    display: grid;
}

/* Мультиграфик */
.layout-1x1 { grid-template: 1fr / 1fr; }
.layout-2x1 { grid-template: 1fr 1fr / 1fr; }
.layout-1x2 { grid-template: 1fr / 1fr 1fr; }
.layout-2x2 { grid-template: 1fr 1fr / 1fr 1fr; }

.chart-item {
    position: relative;
    border: 1px solid var(--border-secondary);
    overflow: hidden;
}

.chart-item:not(:last-child) {
    border-right: 1px solid var(--border-secondary);
    border-bottom: 1px solid var(--border-secondary);
}

/* ==================== CANDLE TOOLTIP ==================== */

#chart-candle-tooltip {
    position: fixed;
    background: var(--bg-elevated);
    border: 2px solid var(--accent-primary);
    border-radius: 8px;
    padding: 12px;
    font-size: 12px;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    min-width: 200px;
    font-family: 'DM Mono', monospace;
    display: none;
}

#chart-candle-tooltip.active {
    display: block;
}

.ct-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
    line-height: 1.4;
    color: var(--text-primary);
}

.ct-label {
    font-weight: 600;
    color: var(--text-secondary);
}

/* ==================== RIGHT PANEL ==================== */

.right-panel {
    flex-shrink: 0;
    width: 380px;
    background: var(--bg-primary);
    border-left: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 20;
    transition: all 0.3s ease;
}

.right-panel.compact {
    width: 320px;
}

.panel-header {
    flex-shrink: 0;
    height: 44px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
}

.panel-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.panel-close {
    width: 32px;
    height: 32px;
    padding: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.panel-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-primary);
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.panel-section {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-secondary);
}

.panel-section:last-child {
    border-bottom: none;
}

.panel-section h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.panel-section h5 {
    font-size: 12px;
    font-weight: 600;
    margin: 8px 0 6px 0;
    color: var(--text-primary);
}

.filter-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.filter-group label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-group input {
    padding: 6px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 12px;
}

.filter-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

/* ==================== CONTEXT MENU ==================== */

.context-menu {
    position: fixed;
    background: var(--bg-elevated);
    border: 1px solid var(--border-secondary);
    border-radius: 8px;
    padding: 8px;
    z-index: 10000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    min-width: 200px;
}

.context-menu-item {
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
    color: var(--text-primary);
}

.context-menu-item:hover {
    background: var(--bg-secondary);
}

/* ==================== FORMS ==================== */

.form-input {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    margin-bottom: 10px;
}

.form-input::placeholder {
    color: var(--text-secondary);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-elevated);
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-secondary);
}

.btn-secondary:hover {
    background: var(--bg-elevated);
    border-color: var(--border-primary);
}

.btn-danger {
    background: #f6465d;
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ==================== MODALS ==================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal[style*="display: none"] {
    display: none !important;
}

.modal-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 24px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 24px;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    margin-top: 20px;
}

.modal-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* ==================== TOAST ==================== */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 13px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    animation: toast-slide 0.3s ease;
    transition: all 0.3s ease;
}

.toast-success {
    border-left: 4px solid #0ecb81;
}

.toast-error {
    border-left: 4px solid #f6465d;
}

.toast-warning {
    border-left: 4px solid #ffa500;
}

.toast-info {
    border-left: 4px solid var(--accent-primary);
}

@keyframes toast-slide {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==================== UTILITIES ==================== */

.no-data {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.error {
    padding: 12px;
    background: #f6465d;
    color: white;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 10px;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 13px;
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    border-radius: 8px;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-secondary);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== SCROLLBAR ==================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-primary);
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }

    .header-controls {
        gap: 4px;
    }

    .header-select {
        padding: 4px 8px;
        font-size: 11px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 96px;
        bottom: 0;
        z-index: 20;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .show-sidebar-btn {
        display: flex;
    }

    .main-content {
        position: relative;
        flex: 1;
    }

    .header-controls {
        flex-wrap: wrap;
        gap: 4px;
    }

    .header-select {
        font-size: 11px;
        padding: 4px 8px;
    }

    .right-panel {
        position: fixed;
        right: -100%;
        top: 96px;
        width: 100%;
        height: calc(100vh - 96px);
        border-left: none;
        border-top: 1px solid var(--border-primary);
        transition: right 0.3s ease;
    }

    .right-panel.active {
        right: 0;
    }

    .toast-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .toast {
        min-width: unset;
    }
}

/* ==================== LIGHT THEME FIXES ==================== */

[data-theme="light"] .sidebar-title,
[data-theme="light"] .ctr-name,
[data-theme="light"] .chb-symbol-btn,
[data-theme="light"] .panel-section h4,
[data-theme="light"] .panel-section h5,
[data-theme="light"] .logo {
    color: #d4af37 !important;
    font-weight: 700;
}

[data-theme="light"] .ctr-price,
[data-theme="light"] .chb-price {
    color: #111827 !important;
}

[data-theme="light"] .ctr-change.positive,
[data-theme="light"] .chb-change.positive {
    color: #0ecb81 !important;
}

[data-theme="light"] .ctr-change.negative,
[data-theme="light"] .chb-change.negative {
    color: #f6465d !important;
}

[data-theme="light"] .group-marker.active {
    background: #d4af37;
    color: white;
    border-color: #d4af37;
}

[data-theme="light"] .btn-primary {
    background: #d4af37;
    color: #111827;
}

[data-theme="light"] .btn-primary:hover {
    opacity: 0.85;
}

/* ==================== UTILITIES ==================== */

.resizer-left {
    width: 1px;
    cursor: col-resize;
    background: transparent;
    transition: background 0.2s;
}

.resizer-left:hover {
    background: var(--accent-primary);
}

.chart-canvas-zone canvas {
    user-select: none;
    -webkit-user-select: none;
}

/* ==================== PRINT ==================== */

@media print {
    .header,
    .ticker-container,
    .sidebar,
    .right-panel,
    .btn,
    button {
        display: none !important;
    }

    .main-content {
        flex: 1;
        width: 100%;
    }
}