.nx-chart-wrapper {
    --nx-text: #000000;
    --nx-text-muted: #4b5563;
    --nx-font: 'Inter', system-ui, -apple-system, sans-serif;
    --nx-bar-h: 40px;
    --nx-radius: 8px;
    --nx-primary: #000000;
    --nx-tooltip-bg: #000000;
    /* สีดำสนิท */

    font-family: var(--nx-font);
    width: 100%;
}

.nx-hidden {
    display: none !important;
}

/* Header Layout */
.nx-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.nx-title-group .nx-main-title {
    margin: 0;
    padding: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--nx-text);
    line-height: 1.2;
}

.nx-title-group .nx-sub-title {
    color: var(--nx-text-muted);
    font-size: 0.875rem;
    margin: 2px 0 0 0;
}

.nx-total-group {
    text-align: right;
}

.nx-total-val {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--nx-primary);
    line-height: 1;
}

.nx-total-label {
    font-size: 0.75rem;
    color: var(--nx-text-muted);
    text-transform: uppercase;
    font-weight: 700;
}

/* Bar Track */
.nx-track {
    width: 100%;
    height: var(--nx-bar-h);
    background-color: #f1f5f9;
    border-radius: var(--nx-radius);
    display: flex;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.nx-segment {
    height: 100%;
    width: 0;
    transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s, transform 0.2s;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transform-origin: center;
}

/* Hover Effect */
.nx-segment:hover {
    filter: saturate(1.4) contrast(1.1);
    transform: scaleY(1.1);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nx-segment-label {
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.4s ease 0.8s;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.nx-segment.is-active .nx-segment-label {
    opacity: 1;
}

/* Legend */
.nx-legend {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.nx-legend-item {
    display: flex;
    align-items: center;
    padding: 4px;
}

.nx-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 8px;
    flex-shrink: 0;
}

.nx-legend-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--nx-text);
}

.nx-legend-pct {
    font-size: 0.75rem;
    color: var(--nx-text-muted);
    margin-left: auto;
}

/* Tooltip Style ปรับให้ดำทึบ 100% */
.nx-tooltip {
    position: fixed;
    background-color: #000000 !important;
    /* บังคับดำทึบ */
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s, transform 0.1s;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid #333333;
    /* ขอบสีเทาเข้มเพื่อให้เห็นขอบเขตชัดเจน */
    font-family: var(--nx-font);
    backdrop-filter: none !important;
    /* ปิดเอฟเฟกต์ใสเบลอ */
}

.nx-tooltip b {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    margin-bottom: 4px;
}

.nx-tooltip-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.nx-tooltip-val {
    font-weight: 800;
    font-size: 1rem;
}

.nx-tooltip-pct {
    color: #10b981;
    font-weight: 600;
}