/* ============================================================================
   STYLESHEET CHO TÍNH NĂNG ORDERBOOK (PIXEL PERFECT DEPTH CHARTS)
   ============================================================================ */

/* Nút timeline và panel chỉnh */
.ob-timeline-container {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.ob-timeline-container .time-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ob-timeline-container .time-btn.active {
    background: #00214a;
    border-color: #00214a;
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 33, 74, 0.2);
}

.ob-timeline-container .time-btn:hover:not(.active) {
    background: #f8fafc;
    border-color: #a1b1bc;
    color: #00214a;
}

/* Biểu đồ song sinh Side-by-Side */
.ob-twin-charts-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    width: 100%;
    margin-top: 15px;
    box-sizing: border-box;
}

/* Khung panel của mỗi biểu đồ */
.ob-chart-panel {
    background: #ffffff;
    border: 1px solid #dee4e6;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: var(--ob-width, 480px) !important;
    margin: 0 auto;
    transition: max-width 0.15s ease-out;
}

.ob-panel-header {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
    min-height: 32px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.ob-panel-title {
    position: absolute;
    left: 0;
    right: 45px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.05rem;
    font-weight: 700;
    color: #6f7378;
    /* Dim gray to avoid being too prominent */
    margin: 0;
    text-align: center;
    pointer-events: none;
}

/* BOTTOM CENTER ZOOM CONTROLS */
.ob-zoom-controls-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    padding-top: 4px;
    box-sizing: border-box;
    width: 100%;
}

.ob-zoom-group {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border-radius: 20px;
    padding: 3px 8px;
    border: 1px solid #cbd5e1;
    gap: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.ob-zoom-icon {
    font-size: 0.95rem;
    user-select: none;
    display: flex;
    align-items: center;
}

.ob-zoom-divider {
    width: 1px;
    height: 16px;
    background: #cbd5e1;
}

/* REDESIGN ZOOM BUTTONS: UNIFORM, SLEEK, PREMIUM CIRCLES */
.ob-zoom-btn {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    border-radius: 50% !important;
    border: none !important;
    background: #ffffff !important;
    color: #475569 !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.15s ease, color 0.15s ease !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    padding: 0 !important;
    line-height: 0 !important;
    /* Force exact center for the glyph container vertical axis */
    font-family: 'Be Vietnam Pro', 'Inter', system-ui, sans-serif !important;
    /* Premium font family for vertically symmetric math symbols */
}

.ob-zoom-btn:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

.ob-zoom-btn:active {
    background: #e2e8f0 !important;
}

/* REMOVE MOTION AND SCALING ANIMATION FOR HORIZONTAL ZOOM BUTTONS, AND REMOVE BORDER */
.ob-width-zoom-group .ob-zoom-btn {
    transition: background 0.15s ease !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    color: #64748b !important;
}

.ob-width-zoom-group .ob-zoom-btn:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    transform: none !important;
    border: none !important;
    box-shadow: none !important;
}

.ob-width-zoom-group .ob-zoom-btn:active {
    transform: none !important;
    background: #e2e8f0 !important;
}

/* Legend và nút reset */
.ob-chart-legend {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    background: transparent;
    margin-bottom: 12px;
    width: calc(100% - 40px);
    box-shadow: none;
    border: none;
    position: relative;
}

.ob-legend-sell,
.ob-legend-buy {
    flex: 1;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: #2d3e50;
    display: block;
}

.ob-legend-spacer {
    width: 2px;
    min-width: 2px;
}

.ob-reset-btn {
    position: absolute !important;
    top: -8px !important;
    right: 0 !important;
    z-index: 10;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    border-radius: 50% !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #475569 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    padding: 0 !important;
}

.ob-reset-btn:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
    transform: scale(1.08) !important;
}

.ob-reset-btn:active {
    transform: scale(0.92) !important;
}

/* Vùng cuộn đồ thị */
.ob-chart-scroll-area {
    height: calc(100vh - 260px);
    min-height: 320px;
    overflow-y: hidden;
    overflow-x: hidden;
    border: 1px solid #ffffff;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    background: #ffffff;
    /* Very light yellow for premium warmth */
    position: relative;
    box-sizing: border-box;
}

/* Đồ thị bên trong với chiều cao cố định để cuộn mượt */
.ob-chart-inner {
    width: 100%;
    height: 100%;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
    background: #ffffff;
    /* Very light yellow for premium warmth */
}

/* Area for depth chart bars (left 100% - 40px) */
.ob-depth-chart-area {
    position: absolute;
    left: 0;
    top: 0;
    width: calc(100% - 40px);
    height: 100%;
    box-sizing: border-box;
    pointer-events: auto;
}

/* Kế hoạch thiết kế Hàng lưới Flexbox Sổ lệnh */
.ob-row {
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    transition: background 0.1s ease;
    z-index: 3;
}

.ob-row:hover {
    background: rgba(0, 33, 74, 0.04);
}

.ob-row-left {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
    position: relative;
    box-sizing: border-box;
}

.ob-row-right {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    height: 100%;
    position: relative;
    box-sizing: border-box;
}

.ob-row-center {
    width: 1px;
    min-width: 1px;
    z-index: 4;
    background: #dee4e6;
    height: 100%;
    box-sizing: border-box;
}

/* Các thanh bar biểu đồ cực nét */
.ob-bar {
    cursor: pointer;
    z-index: 3;
    transition: width 0.3s ease;
    border-radius: 1px;
}

.ob-bar-left {
    border-radius: 2px 0 0 2px;
}

.ob-bar-right {
    border-radius: 0 2px 2px 0;
}

/* Màu Sell/Short */
.ob-bar.ob-bar-orange {
    background: #ff8400 !important;
}

/* Màu Buy/Long */
.ob-bar.ob-bar-blue {
    background: #0aa8bf !important;
}

/* OI change labels: crisp semantic text without the previous white halo. */
.ob-change-label {
    display: inline-block;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 750;
    letter-spacing: -0.01em;
    text-shadow: none;
}

.ob-change-positive {
    color: #047857;
}

.ob-change-negative {
    color: #dc2626;
}

.ob-change-neutral {
    color: #64748b;
}

/* Các đường lưới phần trăm dọc (Percentage Grid Lines) */
.ob-v-grid-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    border-left: 1px solid #e2e8f0;
    pointer-events: none;
    z-index: 1;
}

/* Dòng lưới giá trị ngang */
.ob-grid-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    z-index: 1;
    pointer-events: none;
}

.ob-grid-line::before {
    content: "";
    position: absolute;
    left: 0;
    right: 35px;
    /* stops exactly at the boundary of the bars area */
    top: 0;
    height: 1px;
    background: #e2e8f0;
}

/* Đường giá hiện tại nằm ngang dừng ở mép biểu đồ */
.ob-current-price-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    z-index: 10;
    pointer-events: none;
}

.ob-current-price-line::before {
    content: "";
    position: absolute;
    left: 0;
    right: 40px;
    /* stops exactly at the boundary of the bars area */
    top: 0;
    height: 1px;
    background: #7ea312;
    /* beautiful premium green color */
}

/* Nhãn giá hiện tại nằm đè nổi bật, căn thẳng hàng với mốc giá */
.ob-current-price-tag {
    position: absolute;
    left: calc(100% - 40px);
    /* starts exactly where the green line ends */
    right: auto;
    top: 50%;
    transform: translateY(-50%);
    background: #7ea312;
    color: #ffffff;
    padding: 3px 4px 3px 6px;
    /* left padding of 6px aligns text starting at calc(100% - 34px) */
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.72rem;
    /* Slightly smaller font to guarantee it fits 45px column! */
    font-family: 'Be Vietnam Pro', 'Inter', system-ui, sans-serif;
    z-index: 11;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    border: none;
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
}

.ob-current-price-tag::before {
    content: "";
    position: absolute;
    left: -5px;
    right: auto;
    top: 50%;
    transform: translateY(-50%);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-right: 5px solid #7ea312;
    /* Pointing left */
}

/* Đường Max Pain nằm ngang */
.ob-maxpain-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    z-index: 9;
    pointer-events: none;
}

.ob-maxpain-line::before {
    content: "";
    position: absolute;
    left: 0;
    right: 40px;
    top: 0;
    height: 1px;
    border-top: 1px dashed #a855f7;
}

/* Nhãn Max Pain nằm đè nổi bật, căn thẳng hàng với mốc giá */
.ob-maxpain-tag {
    position: absolute;
    left: calc(100% - 40px);
    right: auto;
    top: 50%;
    transform: translateY(-50%);
    background: #a855f7;
    color: #ffffff;
    padding: 3px 4px 3px 6px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.72rem;
    font-family: 'Be Vietnam Pro', 'Inter', system-ui, sans-serif;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    border: none;
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
}

.ob-maxpain-tag::before {
    content: "";
    position: absolute;
    left: -5px;
    right: auto;
    top: 50%;
    transform: translateY(-50%);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-right: 5px solid #a855f7;
}


/* Trạng thái trống */
.ob-empty-msg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
    font-style: italic;
    text-align: center;
    z-index: 5;
    width: 80%;
}

/* Tùy chỉnh thanh cuộn đẹp mắt cho vùng cuộn */
.ob-chart-scroll-area::-webkit-scrollbar {
    width: 6px;
}

.ob-chart-scroll-area::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 0 12px 12px 0;
}

.ob-chart-scroll-area::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.ob-chart-scroll-area::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* RESPONSIVE CHO TRANG ORDERBOOK */
@media (max-width: 900px) {

    #orderbookOandaPage .sv-main-wrap,
    #orderbookCmePage .sv-main-wrap {
        padding: 6px !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    #orderbookOandaPage .sv-white-board,
    #orderbookCmePage .sv-white-board {
        padding: 10px 8px !important;
        border-radius: 8px !important;
        margin-bottom: 0 !important;
    }

    .ob-twin-charts-container {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .ob-chart-panel {
        padding: 10px 8px !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .ob-chart-scroll-area {
        height: calc(100vh - 280px);
        min-height: 280px;
    }

    .ob-bottom-bar {
        flex-direction: column !important;
        gap: 10px;
        align-items: fill !important;
    }

    .ob-history-slider-inline {
        max-width: 100% !important;
        width: 100%;
    }

    #oandaObSliderLabel,
    #oandaObDateTimeInput,
    #cmeObSliderLabel,
    .ob-history-center-wrap {
        margin-right: auto !important;
    }

    .ob-history-center-wrap {
        position: static !important;
        transform: none !important;
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
    }


    .ob-width-zoom-group {
        display: none !important;
    }

    .ob-compare-btn,
    .ob-compare-spacer,
    .cme-import-btn,
    .oanda-settings-wrapper {
        display: none !important;
    }

    .oanda-star-settings-panel {
        position: absolute !important;
        bottom: calc(100% + 8px) !important;
        left: 0 !important;
        right: auto !important;
        margin-left: 0 !important;
        z-index: 100 !important;
        padding: 8px 12px !important;
        gap: 12px !important;
        border-radius: 10px !important;
    }

    .oanda-settings-input {
        width: 75px !important;
        height: 34px !important;
        font-size: 1.1rem !important;
    }

    .oanda-field-label {
        font-size: 0.9rem !important;
    }

    .oanda-star-settings-btn {
        width: auto !important;
        height: auto !important;
        border-radius: 4px !important;
        background: #e2e8f0 !important;
        border: none !important;
        color: #64748b !important;
        padding: 4px 6px !important;
        box-shadow: none !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .oanda-star-settings-btn:hover {
        background: #cbd5e1 !important;
        color: #0f172a !important;
        transform: scale(1.08) !important;
    }

    .oanda-star-settings-btn.active {
        background: #2563eb !important;
        color: #ffffff !important;
        box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25) !important;
    }

    /* Đưa bộ 3 nút Reset Zoom, Giãn rộng và Co hẹp khoảng cách dọc xuống dưới cùng góc phải trên mobile */
    .ob-price-zoom-group {
        position: fixed !important;
        right: 20px !important;
        bottom: 50px !important;
        top: auto !important;
        left: auto !important;
        margin: 0 !important;
        z-index: 9999 !important;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        height: auto !important;
        gap: 15px !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
    }

    .ob-price-zoom-group .ob-zoom-btn {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        font-size: 1.3rem !important;
        background: rgba(255, 255, 255, 0.75) !important;
        border: none !important;
        backdrop-filter: blur(4px) !important;
        -webkit-backdrop-filter: blur(4px) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
    }

    .ob-price-zoom-group .ob-zoom-btn svg {
        width: 16px !important;
        height: 16px !important;
    }

    .ob-price-zoom-group .ob-mobile-reset-btn {
        display: flex !important;
    }
}

/* CUSTOM TOOLTIP STYLES */
.ob-tooltip {
    position: fixed;
    display: none;
    pointer-events: none;
    z-index: 9999;
    background: #ffffff;
    border-radius: 6px;
    padding: 6px 10px;
    color: #0b0b0b;
    font-size: 0.8rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    font-family: 'Be Vietnam Pro', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.2;
    transition: opacity 0.1s ease;
    border: 2px solid #dee4e6;
}

.ob-tooltip-price {
    font-weight: 700;
    color: #2d3e50;
    border-bottom: 1px solid #dee4e6;
    padding-bottom: 4px;
    margin-bottom: 6px;
    font-size: 0.82rem;
    font-family: 'Be Vietnam Pro', 'Inter', system-ui, sans-serif;
}

.ob-tooltip-row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    font-weight: 600;
    color: #475569;
    font-size: 0.76rem;
}

.ob-tooltip-value {
    font-weight: 700;
    color: #0b0b0b;
    font-family: 'Be Vietnam Pro', 'Inter', system-ui, sans-serif;
}

/* SLEEK GRID PRICE LABELS */
.ob-grid-price-label {
    position: absolute;
    left: calc(100% - 35px);
    /* aligns perfectly close to the left edge of the price column */
    right: auto;
    top: -10px;
    font-size: 0.72rem;
    color: #64748b;
    /* sleeker slate-500 gray color */
    font-weight: 500;
    font-family: 'Be Vietnam Pro', 'Inter', system-ui, sans-serif;
    pointer-events: none;
}

/* HORIZONTAL PERCENTAGE AXIS */
.ob-percentage-axis {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0 0 12px 12px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    font-family: 'Be Vietnam Pro', 'Inter', system-ui, sans-serif;
    box-sizing: border-box;
    width: calc(100% - 40px);
}

.ob-percentage-axis span {
    flex: 1;
    text-align: center;
}

.ob-percentage-axis span.axis-center {
    font-weight: 800;
    color: #2d3e50;
    flex-grow: 0;
    width: 20px;
}

/* Ẩn nút reset zoom mobile trên giao diện desktop */
.ob-mobile-reset-btn {
    display: none !important;
}

/* PRICE ZOOM GROUP */
.ob-price-zoom-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 10px;
    margin: auto 0;
    height: 28px;
}

/* HEADER ROW */
.ob-header-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    min-height: 38px;
    width: 100%;
}

.ob-chart-slider-wrap {
    display: flex;
    justify-content: center;
    margin-top: 8px;
    width: 100%;
}

.ob-header-slider-wrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 480px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 6px 12px;
    box-sizing: border-box;
}

/* Thanh bọc ngoài cùng: Trả về rộng 100% toàn màn hình */
.ob-bottom-bar {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
    padding-top: 10px;
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
    box-sizing: border-box;
    width: 100%;
    position: relative;
    /* Chiếm trọn chiều ngang khung chứa lớn */
}

/* Khối thông tin cập nhật bên trái */
.ob-update-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    white-space: nowrap;
    flex: 1;
    /* Chiếm không gian đều với bên phải để đẩy slider vào giữa */
    justify-content: flex-start;
}

/* Khối nút bấm - / + bên phải */
.ob-width-zoom-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    flex: none;
    margin-left: auto;
}

.ob-history-slider-inline {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: none;
    /* Vô hiệu hóa tính năng tự động co giãn của flexbox */
    width: 100%;
    max-width: var(--ob-width, 480px) !important;
    /* Khớp chuẩn với chiều rộng mặc định của biểu đồ */
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 4px 8px;
    box-sizing: border-box;
    transition: max-width 0.15s ease-out;
    /* Hiệu ứng co giãn mượt mà khi nhấn +/- */
}

.ob-history-btn-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
}

.ob-history-center-wrap {
    position: absolute;
    left: calc(50% - 20px);
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.ob-history-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 6px;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ob-history-btn:hover:not(:disabled) {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.ob-history-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.ob-history-btn:disabled {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #cbd5e1;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

.ob-slider-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    white-space: nowrap;
    min-width: 0;
    text-align: left;
    font-family: inherit;
    padding: 0 2px 0 0;
}

.ob-history-datetime-input {
    font-size: 0.72rem;
    font-weight: 600;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 2px 4px;
    background-color: #ffffff;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ob-history-datetime-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* Selection Overlay for Drag Zoom */
.ob-selection-overlay {
    position: absolute;
    left: 0;
    width: calc(100% - 40px);
    background: rgba(6, 182, 212, 0.15) !important;
    border-top: 1.5px dashed #06b6d4 !important;
    border-bottom: 1.5px dashed #06b6d4 !important;
    pointer-events: none;
    display: none;
    z-index: 10;
}

/* Nút Trang chủ dạng phím tròn cực kỳ cao cấp */
.ob-home-pill-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ffffff;
    border: none;
    color: #94a3b8;
    /* Dim gray to avoid being too prominent */
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
}

.ob-home-pill-btn:hover {
    background: #f1f5f9;
    color: #64748b;
    /* Slightly darker on hover */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}

.ob-home-pill-btn:active {
    background: #e2e8f0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* SLEEK PREMIUM BADGE FOR ORDERBOOK SOURCES (OA / FA) */
.ob-source-badge {
    font-size: 0.72rem;
    font-weight: 800;
    color: #64748b;
    /* Faded/dim slate gray */
    background: #e2e8f0;
    /* Subtle premium light background */
    padding: 3px 6px;
    border-radius: 4px;
    font-family: inherit;
    user-select: none;
    margin-left: 10px;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ob-source-badge:hover {
    background: #cbd5e1;
    /* Elegant hover background */
    color: #0f172a;
    /* Prominent hover text color */
    transform: scale(1.08);
    /* Premium micro-animation scale */
}

.ob-source-badge:active {
    transform: scale(0.95);
    /* Premium micro-animation press */
}

/* ACTIVE STATE FOR COMPARE BTN */
.ob-source-badge.active {
    background: #eab308 !important;
    /* Beautiful premium yellow/gold background when active */
    color: #0f172a !important;
    /* Dark text for perfect contrast */
    border-color: #ca8a04 !important;
}

.ob-source-badge.active:hover {
    background: #ca8a04 !important;
    /* Darker gold on hover */
    color: #ffffff !important;
}

/* --- NÚT FORCE SYNC DÀNH RIÊNG CHO ORDERBOOK --- */
.ob-sync-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    border-radius: 50% !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    cursor: pointer !important;
    transition: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    padding: 0 !important;
    outline: none !important;
}

.ob-sync-btn:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
}

.ob-sync-btn:active {
    background: #e2e8f0 !important;
}

/* Chấm trạng thái bên trong */
.ob-sync-dot {
    width: 8px;
    height: 8px;
    background-color: #64748b;
    border-radius: 50%;
    transition: background-color 0.3s, box-shadow 0.3s;
}

/* Chấm vàng nhấp nháy khi đang tải */
.ob-sync-dot.loading {
    background-color: #eab308;
    /* Vàng kim loại đồng bộ */
    animation: syncPulse 0.8s infinite;
}

/* Chấm xanh phát sáng khi thành công */
.ob-sync-dot.success {
    background-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

/* REDESIGN IMPORT BUTTON FOR CME (MINIMALIST & SLEEK) */
.cme-import-btn {
    position: absolute !important;
    right: 0 !important;
    flex-shrink: 0;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    border-radius: 50% !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #64748b !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    padding: 0 !important;
    line-height: 0 !important;
    outline: none !important;
}

.cme-import-btn:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
    transform: scale(1.08) !important;
}

.cme-import-btn:active {
    transform: scale(0.92) !important;
}

@media (max-width: 900px) {
    .cme-import-btn {
        display: none !important;
    }
}

/* --- VALUE LABELS FOR OANDA LARGE BARS --- */
.ob-bar-value-label {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.70rem;
    font-weight: 700;
    font-family: 'Inter', 'Be Vietnam Pro', sans-serif;
    pointer-events: none;
    z-index: 12;
    line-height: 1.35;
    white-space: nowrap;
    display: inline-block;
    text-align: left;
}

.ob-value-left {
    right: calc(100% + 4px);
    color: #475569;
    text-shadow: 0 0 3px #fff, 0 0 5px #fff, 0 0 8px #fff;
}

.ob-value-right {
    left: calc(100% + 4px);
    color: #475569;
    text-shadow: 0 0 3px #fff, 0 0 5px #fff, 0 0 8px #fff;
}

/* Dòng duration bên dưới giá/% trong nhãn sao */
.ob-label-duration {
    font-size: 0.70rem;
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
    display: block;
}

/* --- STAR ICONS FOR OANDA SUSTAINED PRICES --- */
.oanda-ob-star-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.55rem;
    color: #d97706;
    z-index: 13;
    line-height: 1;
    text-shadow: none;
    border: none;
    outline: none;
}

/* --- OANDA STAR SETTINGS COMPONENT --- */
.oanda-settings-wrapper {
    display: flex;
    align-items: center;
    font-family: 'Be Vietnam Pro', 'Inter', sans-serif;
    position: relative;
}

.oanda-star-settings-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    line-height: 0;
    outline: none;
    user-select: none;
    box-shadow: none;
}

.oanda-star-settings-btn:hover {
    background: #f1f5f9;
    color: #64748b;
    border: none;
    transform: scale(1.05);
}

.oanda-star-settings-btn.active {
    background: #dbeafe;
    color: #2563eb;
    border: none;
    box-shadow: none;
}



.oanda-star-settings-panel {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 0;
    display: flex;
    align-items: center;
    gap: 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 18px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    visibility: hidden;
}

.oanda-star-settings-panel.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    visibility: visible;
}

.oanda-settings-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

.oanda-field-label {
    font-size: 1rem;
    font-weight: 600;
    color: #475569;
    user-select: none;
}

.oanda-settings-input {
    width: 90px;
    height: 40px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    padding: 4px 8px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
    text-align: center;
    outline: none;
    transition: all 0.2s ease-in-out;
}

.oanda-settings-input:focus {
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Force spinner arrows to be always visible and large */
.oanda-settings-input::-webkit-inner-spin-button,
.oanda-settings-input::-webkit-outer-spin-button {
    opacity: 1 !important;
    height: 32px;
    width: 20px;
    cursor: pointer;
    margin-left: 2px;
}




/* Custom styling for Oanda value label toggle button to make it premium, smaller and easier to click (gray tone) */
#oandaObLabelToggleBtn {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: 1px solid #cbd5e1 !important;
    color: #94a3b8;
    box-shadow: none !important;
    margin-left: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#oandaObLabelToggleBtn:hover {
    border-color: #94a3b8 !important;
    color: #64748b;
    transform: scale(1.08);
}

#oandaObLabelToggleBtn:active {
    transform: scale(0.95);
}

/* State 1: Active Star -> Medium gray border and SVG color */
#oandaObLabelToggleBtn.active-star {
    background: transparent !important;
    border-color: #64748b !important;
    color: #64748b !important;
}

#oandaObLabelToggleBtn.active-star:hover {
    border-color: #475569 !important;
    color: #475569 !important;
}

/* State 2: Active All -> Dark gray border and SVG color */
#oandaObLabelToggleBtn.active-all {
    background: transparent !important;
    border-color: #334155 !important;
    color: #334155 !important;
}

#oandaObLabelToggleBtn.active-all:hover {
    border-color: #0f172a !important;
    color: #0f172a !important;
}

/* Responsive adjustment for mobile screen width */
@media (max-width: 900px) {
    #oandaObLabelToggleBtn {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
        box-shadow: none !important;
    }
}

/* ĐẢM BẢO NHÃN ĐÁNH DẤU SAO OANDA LUÔN HIỂN THỊ OVERLAY TRÊN MỌI THÀNH PHẦN KHÔNG BỊ CHE KHUẤT */
#orderbookOandaPage .ob-chart-panel,
#orderbookOandaPage .ob-chart-panel>div,
#orderbookOandaPage .ob-chart-scroll-area,
#orderbookOandaPage .ob-chart-inner,
#orderbookOandaPage .ob-depth-chart-area,
#orderbookOandaPage .ob-row,
#orderbookOandaPage .ob-row-left,
#orderbookOandaPage .ob-row-right,
#orderbookOandaPage .ob-bar {
    overflow: visible !important;
}

#orderbookOandaPage .ob-bar-value-label,
#orderbookOandaPage .oanda-ob-star-icon {
    z-index: 99999 !important;
}

#orderbookOandaPage .ob-bar-value-label {
    text-shadow: 0 0 3px #ffffff, 0 0 6px #ffffff, 0 0 10px #ffffff, 0 0 15px #ffffff !important;
}

/* ============================================================================
   REDESIGNED CME IMPORT MODAL STYLING (PREMIUM UI/UX)
   ============================================================================ */
.cme-import-container {
    padding: 2px 5px;
    font-family: 'Be Vietnam Pro', 'Inter', sans-serif;
}

/* Tabs */
.cme-import-tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
    gap: 15px;
}

.cme-import-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    margin-bottom: -2px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cme-import-tab-btn:hover {
    color: #0ea5e9;
}

.cme-import-tab-btn.active {
    color: #0ea5e9;
    border-bottom-color: #0ea5e9;
}

/* Tab contents */
.cme-import-tab-content {
    display: none;
    animation: fadeInCmeTab 0.25s ease-in-out forwards;
}

.cme-import-tab-content.active {
    display: block;
}

@keyframes fadeInCmeTab {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dropzone styling */
.cme-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.cme-dropzone:hover,
.cme-dropzone.dragover {
    border-color: #0ea5e9;
    background: #f0f9ff;
}

.cme-dropzone-icon {
    font-size: 2.2rem;
    color: #0ea5e9;
    transition: transform 0.2s ease;
}

.cme-dropzone:hover .cme-dropzone-icon {
    transform: translateY(-3px);
}

.cme-dropzone-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #1e293b;
}

.cme-dropzone-desc {
    font-size: 0.76rem;
    color: #64748b;
}

/* File Info Card */
.cme-file-card {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 12px 16px;
    margin-top: 15px;
    margin-bottom: 15px;
    display: none;
    animation: slideDownCme 0.3s ease-out forwards;
}

.cme-file-card.show {
    display: block;
}

@keyframes slideDownCme {
    from {
        opacity: 0;
        max-height: 0;
        overflow: hidden;
        padding-top: 0;
        padding-bottom: 0;
        margin-top: 0;
    }

    to {
        opacity: 1;
        max-height: 200px;
        padding-top: 12px;
        padding-bottom: 12px;
        margin-top: 15px;
    }
}

.cme-file-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #15803d;
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 6px;
}

.cme-file-card-details {
    font-size: 0.78rem;
    color: #166534;
    line-height: 1.5;
    font-family: monospace;
}

/* Tip & Info box */
.cme-info-box {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.78rem;
    color: #0369a1;
    line-height: 1.5;
    margin-top: 15px;
    margin-bottom: 15px;
}

.cme-info-box strong {
    color: #0369a1;
}

/* Monospace code view for Copy Format */
.cme-code-block {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    font-family: monospace;
    font-size: 0.76rem;
    color: #334155;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Dark mode overrides (respecting data-theme=dark) */
[data-theme="dark"] .cme-dropzone {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .cme-dropzone:hover,
[data-theme="dark"] .cme-dropzone.dragover {
    background: rgba(14, 165, 233, 0.1);
    border-color: #0ea5e9;
}

[data-theme="dark"] .cme-dropzone-title {
    color: #f1f5f9;
}

[data-theme="dark"] .cme-dropzone-desc {
    color: #94a3b8;
}

[data-theme="dark"] .cme-import-tab-btn {
    color: #94a3b8;
}

[data-theme="dark"] .cme-import-tab-btn:hover {
    color: #0ea5e9;
}

[data-theme="dark"] .cme-import-tab-btn.active {
    color: #0ea5e9;
    border-bottom-color: #0ea5e9;
}

[data-theme="dark"] .cme-import-tabs {
    border-bottom-color: #334155;
}

[data-theme="dark"] .cme-code-block {
    background: #0f172a;
    border-color: #1e293b;
    color: #cbd5e1;
}

[data-theme="dark"] .cme-file-card {
    background: rgba(21, 128, 61, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
}

[data-theme="dark"] .cme-file-card-header {
    color: #4ade80;
}

[data-theme="dark"] .cme-file-card-details {
    color: #86efac;
}

[data-theme="dark"] .cme-info-box {
    background: rgba(3, 105, 161, 0.15);
    border-color: rgba(14, 165, 233, 0.3);
    color: #38bdf8;
}

[data-theme="dark"] .cme-info-box strong {
    color: #38bdf8;
}

/* ============================================================================
   CME IMPORT — 2026 WORKFLOW REDESIGN
   ============================================================================ */
.cme-import-overlay {
    padding: 24px;
    box-sizing: border-box;
    z-index: 50000;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.cme-import-container {
    width: min(760px, 100%) !important;
    max-width: 760px !important;
    max-height: min(880px, calc(100vh - 48px));
    padding: 0 !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 22px;
    background: #ffffff !important;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28), 0 2px 8px rgba(15, 23, 42, 0.08);
    color: #0f172a;
    font-family: 'Be Vietnam Pro', 'Inter', sans-serif;
}

.cme-import-container,
.cme-import-container * {
    box-sizing: border-box;
}

.cme-import-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 26px 20px;
    border-bottom: 1px solid #e8edf4;
    background:
        radial-gradient(circle at 10% 0%, rgba(14, 165, 233, 0.09), transparent 35%),
        linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.cme-import-heading {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.cme-import-heading-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(145deg, #0ea5e9 0%, #2563eb 100%);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.24);
}

.cme-import-heading-icon svg {
    width: 22px;
    height: 22px;
}

.cme-import-eyebrow {
    display: block;
    margin: 0 0 3px;
    color: #0284c7;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.13em;
}

.cme-import-heading h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.22rem;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -0.025em;
}

.cme-import-heading p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.5;
}

.cme-import-container .cme-import-close {
    position: static;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    color: #64748b;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.cme-import-container .cme-import-close:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
}

.cme-import-close svg {
    width: 18px;
    height: 18px;
}

.cme-import-body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 20px 26px 22px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.cme-import-body::-webkit-scrollbar {
    width: 5px;
}

.cme-import-body::-webkit-scrollbar-thumb {
    border-radius: 5px;
    background: #cbd5e1;
}

.cme-import-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 18px;
    padding: 0;
    border: 0;
}

.cme-import-tab-btn {
    min-width: 0;
    min-height: 70px;
    margin: 0;
    padding: 12px 13px;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) 22px;
    align-items: center;
    gap: 10px;
    text-align: left;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #ffffff;
    color: #64748b;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.cme-import-tab-btn:hover {
    border-color: #bae6fd;
    background: #f8fcff;
    color: #0369a1;
}

.cme-import-tab-btn.active {
    border-color: #38bdf8;
    background: linear-gradient(145deg, #f0f9ff 0%, #f8fbff 100%);
    color: #0369a1;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.08);
}

.cme-import-tab-index {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
}

.cme-import-tab-btn.active .cme-import-tab-index {
    background: #0ea5e9;
    color: #ffffff;
}

.cme-import-tab-btn>span:nth-child(2) {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cme-import-tab-btn strong {
    overflow: hidden;
    color: #1e293b;
    font-size: 0.78rem;
    font-weight: 750;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cme-import-tab-btn small {
    color: #94a3b8;
    font-size: 0.66rem;
    font-weight: 500;
    line-height: 1.35;
}

.cme-import-tab-btn>svg {
    width: 21px;
    height: 21px;
    color: #94a3b8;
}

.cme-import-tab-btn.active>svg {
    color: #0ea5e9;
}

.cme-import-tab-content {
    display: none;
    animation: fadeInCmeTab 0.2s ease-out forwards;
}

.cme-import-tab-content.active {
    display: block;
}

.cme-dropzone {
    min-height: 156px;
    padding: 26px 22px 23px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    grid-template-areas:
        "icon copy action"
        "icon format action";
    align-items: center;
    gap: 3px 15px;
    text-align: left;
    border: 1.5px dashed #cbd5e1;
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(14, 165, 233, 0.035), transparent 48%),
        #f8fafc;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.cme-dropzone:hover,
.cme-dropzone:focus-visible,
.cme-dropzone.dragover {
    border-color: #0ea5e9;
    outline: none;
    background: #f0f9ff;
    transform: translateY(-1px);
}

.cme-dropzone.has-file {
    border-style: solid;
    border-color: #86efac;
    background: #f0fdf4;
}

.cme-dropzone-icon {
    grid-area: icon;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #e0f2fe;
    color: #0284c7;
    transition: transform 0.18s ease;
}

.cme-dropzone:hover .cme-dropzone-icon {
    transform: translateY(-2px);
}

.cme-dropzone-icon svg {
    width: 24px;
    height: 24px;
}

.cme-dropzone-copy {
    grid-area: copy;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cme-dropzone-title {
    overflow: hidden;
    color: #0f172a;
    font-size: 0.85rem;
    font-weight: 750;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cme-dropzone-desc,
.cme-dropzone-format {
    color: #64748b;
    font-size: 0.68rem;
    line-height: 1.45;
}

.cme-dropzone-format {
    grid-area: format;
    color: #94a3b8;
}

.cme-dropzone-action {
    grid-area: action;
    padding: 9px 14px;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    background: #ffffff;
    color: #0369a1;
    font-size: 0.72rem;
    font-weight: 750;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.04);
}

.cme-file-card {
    margin: 10px 0 0;
    padding: 12px 14px;
    display: none;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    background: #f0fdf4;
    animation: slideDownCme 0.22s ease-out forwards;
}

.cme-file-card.show {
    display: grid;
}

.cme-file-card-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #dcfce7;
    color: #16a34a;
}

.cme-file-card-icon svg {
    width: 20px;
    height: 20px;
}

.cme-file-card-header {
    margin: 0 0 3px;
    color: #166534;
    font-size: 0.73rem;
    font-weight: 750;
}

.cme-file-card-details {
    color: #4d7c5a;
    font-family: 'Be Vietnam Pro', 'Inter', sans-serif;
    font-size: 0.65rem;
    line-height: 1.55;
}

.cme-file-card-details br {
    display: none;
}

.cme-file-card-details strong {
    color: #166534;
}

.cme-code-block {
    min-height: 48px;
    margin: 0 0 11px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    background: #f8fafc;
    color: #475569;
    font-size: 0.65rem;
    line-height: 1.45;
    white-space: nowrap;
}

.cme-code-label {
    padding: 4px 6px;
    border-radius: 6px;
    background: #e2e8f0;
    color: #475569;
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.cme-code-block code {
    color: #0f172a;
    font-weight: 700;
}

.cme-code-example {
    margin-left: auto;
    color: #94a3b8;
}

.cme-paste-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.cme-paste-panel {
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #ffffff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.cme-paste-panel:focus-within {
    border-color: #7dd3fc;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.08);
}

.cme-paste-panel-head {
    min-height: 39px;
    padding: 9px 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e8edf4;
    background: #f8fafc;
}

.cme-paste-panel-head label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #334155;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.cme-paste-panel-head>span {
    color: #94a3b8;
    font-size: 0.6rem;
    font-weight: 600;
}

.cme-option-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.cme-paste-panel.puts .cme-option-dot {
    background: #f43f5e;
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.11);
}

.cme-paste-panel .sv-textarea {
    width: 100%;
    height: 118px;
    min-height: 118px;
    padding: 12px;
    display: block;
    resize: vertical;
    border: 0;
    outline: none;
    background: #ffffff;
    color: #1e293b;
    font: 500 0.68rem/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.cme-paste-panel .sv-textarea::placeholder {
    color: #a8b3c2;
}

.cme-info-box {
    margin: 10px 0 0;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 7px;
    border: 0;
    border-radius: 9px;
    background: #f0f9ff;
    color: #0c6f9d;
    font-size: 0.65rem;
    line-height: 1.5;
}

.cme-info-box svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}

.cme-import-meta {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    background: #fbfcfe;
}

.cme-import-section-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.cme-import-section-title>div>span {
    display: block;
    margin-bottom: 2px;
    color: #0284c7;
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.09em;
}

.cme-import-section-title h3 {
    margin: 0;
    color: #1e293b;
    font-size: 0.84rem;
    font-weight: 750;
    line-height: 1.4;
}

.cme-import-required-note {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #94a3b8;
    font-size: 0.6rem;
    font-weight: 600;
}

.cme-import-required-note i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f43f5e;
}

.cme-import-fields {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 11px;
}

.cme-import-fields .sv-form-group {
    min-width: 0;
    margin: 0;
}

.cme-import-fields .sv-label {
    margin: 0 0 6px;
    color: #475569;
    font-size: 0.66rem;
    font-weight: 700;
}

.cme-import-fields .sv-label span {
    color: #f43f5e;
}

.cme-import-fields .sv-input {
    width: 100%;
    height: 42px;
    padding: 0 11px;
    border: 1px solid #dbe3ec;
    border-radius: 10px;
    outline: none;
    background: #ffffff;
    color: #0f172a;
    font: 600 0.75rem 'Be Vietnam Pro', 'Inter', sans-serif;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.cme-import-fields .sv-input:focus {
    border-color: #38bdf8;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.09);
}

.cme-spot-input {
    position: relative;
}

.cme-spot-input .sv-input {
    padding-right: 48px;
}

.cme-spot-input>span {
    position: absolute;
    top: 50%;
    right: 11px;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.6rem;
    font-weight: 800;
    pointer-events: none;
}

.cme-import-footer {
    flex: 0 0 auto;
    padding: 15px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid #e8edf4;
    background: #ffffff;
}

.cme-import-ready {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
}

.cme-import-ready>span {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #cbd5e1;
    box-shadow: 0 0 0 4px rgba(203, 213, 225, 0.22);
}

.cme-import-ready.is-ready>span {
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.13);
}

.cme-import-ready p {
    min-width: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.cme-import-ready strong {
    color: #475569;
    font-size: 0.66rem;
    font-weight: 750;
}

.cme-import-ready.is-ready strong {
    color: #15803d;
}

.cme-import-ready small {
    overflow: hidden;
    max-width: 280px;
    color: #94a3b8;
    font-size: 0.58rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cme-import-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cme-import-cancel,
.cme-import-submit {
    height: 40px;
    padding: 0 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 750;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.cme-import-cancel {
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
}

.cme-import-cancel:hover {
    background: #f8fafc;
    color: #334155;
}

.cme-import-submit {
    min-width: 132px;
    gap: 8px;
    border: 0;
    background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.24);
}

.cme-import-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.3);
}

.cme-import-submit:active:not(:disabled) {
    transform: translateY(0);
}

.cme-import-submit:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

.cme-import-submit svg {
    width: 17px;
    height: 17px;
}

.cme-import-submit.is-loading svg {
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: cmeImportSpin 0.7s linear infinite;
}

.cme-import-submit.is-loading svg path {
    opacity: 0;
}

@keyframes cmeImportSpin {
    to {
        transform: rotate(360deg);
    }
}

[data-theme="dark"] .cme-import-container {
    border-color: #283548;
    background: #101827 !important;
    color: #f8fafc;
}

[data-theme="dark"] .cme-import-header,
[data-theme="dark"] .cme-import-footer {
    border-color: #243044;
    background: #101827;
}

[data-theme="dark"] .cme-import-heading h2,
[data-theme="dark"] .cme-import-tab-btn strong,
[data-theme="dark"] .cme-dropzone-title,
[data-theme="dark"] .cme-import-section-title h3 {
    color: #f1f5f9;
}

[data-theme="dark"] .cme-import-container .cme-import-close,
[data-theme="dark"] .cme-import-tab-btn,
[data-theme="dark"] .cme-dropzone-action,
[data-theme="dark"] .cme-paste-panel,
[data-theme="dark"] .cme-paste-panel .sv-textarea,
[data-theme="dark"] .cme-import-fields .sv-input {
    border-color: #334155;
    background: #172033;
    color: #e2e8f0;
}

[data-theme="dark"] .cme-import-tab-btn.active {
    border-color: #0ea5e9;
    background: rgba(14, 165, 233, 0.12);
}

[data-theme="dark"] .cme-dropzone,
[data-theme="dark"] .cme-import-meta,
[data-theme="dark"] .cme-code-block,
[data-theme="dark"] .cme-paste-panel-head {
    border-color: #334155;
    background: #131d2e;
}

[data-theme="dark"] .cme-code-block code,
[data-theme="dark"] .cme-paste-panel-head label {
    color: #dbeafe;
}

[data-theme="dark"] .cme-import-fields .sv-input:focus {
    border-color: #38bdf8;
    background: #172033;
}

[data-theme="dark"] .cme-import-cancel {
    border-color: #334155;
    background: #172033;
    color: #cbd5e1;
}

@media (max-width: 640px) {
    .cme-import-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .cme-import-container {
        width: 100% !important;
        max-height: 94vh;
        border-width: 1px 0 0;
        border-radius: 22px 22px 0 0;
    }

    .cme-import-header {
        padding: 19px 18px 16px;
    }

    .cme-import-heading-icon {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
        border-radius: 12px;
    }

    .cme-import-heading p {
        display: none;
    }

    .cme-import-body {
        padding: 16px 18px 19px;
    }

    .cme-import-tab-btn {
        min-height: 58px;
        grid-template-columns: 27px minmax(0, 1fr);
        padding: 10px;
    }

    .cme-import-tab-index {
        width: 27px;
        height: 27px;
    }

    .cme-import-tab-btn>svg,
    .cme-import-tab-btn small {
        display: none;
    }

    .cme-dropzone {
        min-height: 174px;
        grid-template-columns: 44px minmax(0, 1fr);
        grid-template-areas:
            "icon copy"
            "format format"
            "action action";
        padding: 22px;
    }

    .cme-dropzone-action {
        margin-top: 9px;
        text-align: center;
    }

    .cme-code-example {
        display: none;
    }

    .cme-paste-grid,
    .cme-import-fields {
        grid-template-columns: 1fr;
    }

    .cme-paste-panel .sv-textarea {
        height: 104px;
        min-height: 104px;
    }

    .cme-import-footer {
        padding: 13px 18px max(13px, env(safe-area-inset-bottom));
    }

    .cme-import-ready {
        display: none;
    }

    .cme-import-actions {
        width: 100%;
    }

    .cme-import-cancel {
        flex: 0 0 auto;
    }

    .cme-import-submit {
        flex: 1 1 auto;
    }
}

@media (prefers-reduced-motion: reduce) {

    .cme-import-container,
    .cme-import-container *,
    .cme-import-container *::before,
    .cme-import-container *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* CME multi-file CSV import */
.cme-file-card {
    align-items: flex-start;
}

.cme-file-card.has-error {
    border-color: #fecaca;
    background: #fff7f7;
}

.cme-file-card-content {
    min-width: 0;
}

.cme-batch-file-list {
    max-height: 230px;
    display: grid;
    gap: 6px;
    overflow-y: auto;
    padding-right: 3px;
    scrollbar-width: thin;
    scrollbar-color: #bbf7d0 transparent;
}

.cme-batch-file-row {
    min-width: 0;
    min-height: 43px;
    padding: 7px 8px;
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto 24px;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(187, 247, 208, 0.85);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.72);
}

.cme-batch-file-state {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.cme-batch-file-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cme-batch-file-main strong,
.cme-batch-file-main span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cme-batch-file-main strong {
    color: #14532d;
    font-size: 0.65rem;
    font-weight: 750;
}

.cme-batch-file-main span {
    color: #4d7c5a;
    font-size: 0.58rem;
}

.cme-batch-file-status {
    padding: 3px 6px;
    border-radius: 999px;
    background: #dcfce7;
    color: #15803d;
    font-size: 0.54rem;
    font-weight: 750;
    white-space: nowrap;
}

.cme-batch-file-remove {
    width: 24px;
    height: 24px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #94a3b8;
    font: 500 1rem/1 sans-serif;
    cursor: pointer;
}

.cme-batch-file-remove:hover {
    background: #fee2e2;
    color: #e11d48;
}

.cme-batch-file-row.is-reading .cme-batch-file-state,
.cme-batch-file-row.is-importing .cme-batch-file-state {
    border: 2px solid #bae6fd;
    border-top-color: #0284c7;
    background: transparent;
    box-shadow: none;
    animation: cmeImportSpin 0.7s linear infinite;
}

.cme-batch-file-row.is-reading .cme-batch-file-status,
.cme-batch-file-row.is-importing .cme-batch-file-status {
    background: #e0f2fe;
    color: #0369a1;
}

.cme-batch-file-row.is-success {
    opacity: 0.72;
}

.cme-batch-file-row.is-invalid,
.cme-batch-file-row.is-error {
    border-color: #fecaca;
    background: #fffafa;
}

.cme-batch-file-row.is-invalid .cme-batch-file-state,
.cme-batch-file-row.is-error .cme-batch-file-state {
    background: #f43f5e;
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.1);
}

.cme-batch-file-row.is-invalid .cme-batch-file-main strong,
.cme-batch-file-row.is-error .cme-batch-file-main strong {
    color: #9f1239;
}

.cme-batch-file-row.is-invalid .cme-batch-file-main span,
.cme-batch-file-row.is-error .cme-batch-file-main span {
    color: #be123c;
}

.cme-batch-file-row.is-invalid .cme-batch-file-status,
.cme-batch-file-row.is-error .cme-batch-file-status {
    background: #ffe4e6;
    color: #be123c;
}

.cme-import-meta.is-batch-mode .cme-manual-meta-field {
    display: none;
}

.cme-import-meta.is-batch-mode .cme-import-fields {
    grid-template-columns: minmax(220px, 1fr);
}

.cme-import-meta.is-batch-mode .cme-spot-meta-field {
    max-width: 330px;
}

.cme-import-fields .sv-label small {
    margin-left: 5px;
    color: #94a3b8;
    font-size: 0.56rem;
    font-weight: 500;
}

[data-theme="dark"] .cme-file-card.has-error,
[data-theme="dark"] .cme-batch-file-row.is-invalid,
[data-theme="dark"] .cme-batch-file-row.is-error {
    border-color: rgba(244, 63, 94, 0.35);
    background: rgba(136, 19, 55, 0.16);
}

[data-theme="dark"] .cme-batch-file-row {
    border-color: #334155;
    background: rgba(15, 23, 42, 0.48);
}

[data-theme="dark"] .cme-batch-file-main strong {
    color: #dcfce7;
}

[data-theme="dark"] .cme-batch-file-main span {
    color: #86efac;
}

@media (max-width: 640px) {
    .cme-batch-file-row {
        grid-template-columns: 8px minmax(0, 1fr) 24px;
    }

    .cme-batch-file-status {
        display: none;
    }

    .cme-import-meta.is-batch-mode .cme-spot-meta-field {
        max-width: none;
    }
}