body {
    margin: 0;
    padding: 0;
    background-color: #09090b; /* Zinc 950 */
    color: #f4f4f5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    box-sizing: border-box;
}

::-webkit-scrollbar {width: 10px;}
::-webkit-scrollbar-track {background: #09090b;}
::-webkit-scrollbar-thumb {
    background: #27272a;
    border-radius: 5px;
    border: 2px solid #09090b;
}
::-webkit-scrollbar-thumb:hover {
    background: #3f3f46;
}

/* Connection Indicator */
.connection-indicator {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
}

.connection-indicator.connected {
    background: rgba(16, 185, 129, 0.1);
    color: #059669; /* emerald-500 */
    border: 2px solid #059669;
}

.connection-indicator.disconnected {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444; /* rose-500 */
    border: 2px solid #ef4444;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.status-dot.green {
    background: #059669;
}

.status-dot.red {
    background: #ef4444;
}

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

/* Cell Display */
.cell-item {
    /* Updated background color from slate to zinc */
    background: rgba(39, 39, 42, 0.4); /* zinc-800 */
    padding: 4px 8px;
    border-radius: 4px;
    text-align: center;
    font-size: 0.75rem;
    transition: all 0.2s;
    height: auto;
}

.cell-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    background: rgba(39, 39, 42, 0.8);
}

.cell-normal {
    border-left: 3px solid #059669;
}

.cell-warning {
    border-left: 3px solid #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.cell-danger {
    border-left: 3px solid #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.cell-label {
    font-size: 0.65rem;
    color: #a1a1aa; /* zinc-400 */
    margin-bottom: 2px;
}

.cell-value {
    font-weight: 700;
    font-size: 0.8rem;
    color: #ffffff;
}

/* Collapsible Section */
.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.collapsible-content {
    max-height: 10000px;
    overflow: hidden;
    transition: max-height 0.5s ease-out, opacity 0.3s;
    opacity: 1;
}

/* Segment Stats */
.segment-header {
    /* Updated gradient from purple/blue to a subtle dark zinc layout */
    background: rgba(39, 39, 42, 0.4);
    border: 1px solid rgba(63, 63, 70, 0.4);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.segment-stat {
    display: inline-block;
    margin-right: 20px;
    font-size: 0.875rem;
}

.segment-stat-label {
    color: #a1a1aa;
    margin-right: 4px;
}

.segment-stat-value {
    font-weight: 700;
}

/* Temperature Colors */
.temp-cold {
    color: #059669;
}

.temp-warm {
    color: #f59e0b;
}

.temp-hot {
    color: #ef4444;
}

/* Accumulator Overview Stats */
.stat-card {
    /* Updated background color from slate to zinc */
    background: rgba(39, 39, 42, 0.4); /* zinc-900/50 */
    border: 1px solid rgba(39, 39, 42, 0.6); /* zinc-800 */
    border-radius: 12px;
    padding: 16px;
    border-left: 4px solid #ffffff; /* Default left border set to Battery Amber */
}

.stat-label {
    font-size: 0.75rem;
    color: #71717a;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
}

.stat-subtext {
    font-size: 0.75rem;
    color: #52525b;
    margin-top: 8px;
}

.stat-mini {
    font-size: 0.7rem;
    color: #a1a1aa;
    margin-top: 4px;
}

/* Segment Overview */
.segment-overview-card {
    background: rgba(24, 24, 27, 0.3);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid rgba(63, 63, 70, 0.3);
}

.segment-overview-voltage-section,
.segment-overview-temp-section {
    cursor: pointer;
    padding: 8px;
    margin: -8px -8px 4px -8px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.segment-overview-voltage-section:hover {
    background: rgba(0, 0, 0, 0.1); 
}

.segment-overview-temp-section {
    margin: 4px -8px -8px -8px;
}

.segment-overview-temp-section:hover {
    background: rgba(0, 0, 0, 0.1); 
}

.segment-overview-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #a1a1aa;
    margin-bottom: 8px;
}

.segment-overview-stats {
    display: flex;
    gap: 16px;
    font-size: 0.75rem;
}

.segment-overview-stat {
    flex: 1;
}

.segment-overview-label {
    color: #52525b;
    margin-bottom: 2px;
}

.segment-overview-value {
    font-weight: 700;
    font-size: 0.875rem;
    color: #ffffff;
}

/* Segment Overview Table */
#segment-overview-table tbody tr {
    border-bottom: 1px solid rgb(60, 60, 60);
    transition: background-color 0.2s;
}

#segment-overview-table tbody tr:hover {
    background: rgba(39, 39, 42, 0.4);
}

#segment-overview-table tbody td {
    padding: 12px 16px;
}

#segment-overview-table .segment-name {
    font-weight: 700;
    color: #a1a1aa;
    cursor: pointer;
}

#segment-overview-table .voltage-cell:hover {
    background: rgba(50, 50, 50, 0.6);
}

#segment-overview-table .temp-cell:hover {
    background: rgba(50, 50, 50, 0.6);
}

.chart-container-small {
    position: relative;
    height: 220px;
}