/* ========================================
   LIVE MONITOR PAGE STYLES
   Extracted from LiveMonitor.razor
   ======================================== */

/* ========== PAGE LAYOUT ========== */
/* Allow page content to grow naturally and scroll when needed */
.page-transition-wrapper:has(.live-monitor-container),
.page-content:has(.live-monitor-container) {
    height: auto !important;
    min-height: 100%;
}

.live-monitor-container {
    padding: 1rem;
    padding-bottom: 5rem; /* Extra space for floating button */
    max-width: 100%;
    box-sizing: border-box;
}

.history-view-button {
    display: flex;
    justify-content: right;
    margin-top: -14px;
    margin-bottom: -13px;
}

/* ========== HEADER CARD ========== */
.live-monitor-container .header-card {
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.live-monitor-container .header-card > .e-card-content {
    padding: 0.75rem 1rem !important;
}

.live-monitor-container .header-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "title"
        "actions";
    align-items: stretch;
    gap: 0.65rem;
    padding: 0;
    position: static;
}

.live-monitor-container .header-title-row {
    grid-area: title;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
}

.live-monitor-container .header-state-indicators {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex: 0 0 auto;
}

.live-monitor-container .bluetooth-direct-indicator {
    width: 2.35rem;
    height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(22, 141, 255, 0.5);
    border-radius: 50%;
    background: rgba(22, 141, 255, 0.14);
    color: #168dff;
    box-shadow: 0 0 18px rgba(22, 141, 255, 0.28);
}

.live-monitor-container .bluetooth-direct-indicator i {
    font-size: 1.25rem;
    line-height: 1;
    color: #000000;
    --fa-primary-color: #000000;
    --fa-secondary-color: #000000;
    --fa-primary-opacity: 1;
    --fa-secondary-opacity: 0.55;
}

.direct-connect-setup-dialog .direct-connect-setup-dialog-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.direct-connect-setup-dialog .direct-connect-setup-dialog-header h5 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #e8fdff;
}

.direct-connect-setup-dialog .direct-connect-setup-dialog-body {
    display: grid;
    gap: 1rem;
}

.direct-connect-setup-dialog .direct-connect-setup-summary {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0.85rem;
    border-radius: 8px;
    background: rgba(0, 188, 212, 0.08);
    border: 1px solid rgba(0, 188, 212, 0.2);
}

.direct-connect-setup-dialog .direct-connect-setup-label {
    color: rgba(255, 255, 255, 0.68);
}

.direct-connect-setup-dialog .direct-connect-setup-value {
    color: #ffffff;
    font-weight: 700;
    overflow-wrap: anywhere;
    text-align: right;
}

.direct-connect-setup-dialog .direct-connect-setup-dialog-body p {
    margin: 0;
    color: rgba(255, 255, 255, 0.76);
    line-height: 1.45;
}

.direct-connect-setup-dialog .direct-connect-setup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.live-monitor-container .header-actions-row {
    grid-area: actions;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
}

.live-monitor-container .btn-back {
    white-space: nowrap;
    position: relative;
    left: auto;
    flex: 0 0 auto;
}

.live-monitor-container .header-text {
    min-width: 0;
    text-align: left;
    flex: initial;
}

.live-monitor-container .header-text h1 {
    margin: 0;
    font-size: 1.8rem;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    white-space: nowrap;
    word-break: normal;
}

.live-monitor-container .header-text h1 i {
    flex: 0 0 auto;
}

.live-monitor-container .live-monitor-title-icon {
    flex: 0 0 auto;
}

.live-monitor-container .live-monitor-title-label {
    flex: 0 0 auto;
}

.live-monitor-container .header-text h1 .editable-identity {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    max-width: 100%;
}

.editable-name-swap {
    position: relative;
    display: inline-grid;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    border-radius: 8px;
    outline: none;
    cursor: default;
}

.editable-name-primary,
.editable-name-secondary {
    grid-area: 1 / 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.12s ease, transform 0.12s ease, filter 0.12s ease;
}

.editable-name-primary {
    opacity: 1;
    transform: translateY(0);
}

.editable-name-secondary {
    opacity: 0;
    transform: translateY(0.22rem);
    filter: blur(1px);
    font-family: "Consolas", "SFMono-Regular", "Liberation Mono", monospace;
    letter-spacing: 0.05em;
}

.editable-name-swap:is(:hover, :focus, :focus-visible, :focus-within) .editable-name-primary {
    opacity: 0;
    transform: translateY(-0.22rem);
    filter: blur(1px);
}

.editable-name-swap:is(:hover, :focus, :focus-visible, :focus-within) .editable-name-secondary {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

.editable-name-swap:focus-visible {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.sentinel-name-swap {
    max-width: min(72vw, 42ch);
}

.edit-name-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    cursor: pointer;
    transition: transform 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}

.edit-name-trigger:hover,
.edit-name-trigger:focus-visible {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.header-edit-name-trigger {
    flex: 0 0 auto;
}

/* ========== LIVE MONITOR NAME MODALS ========== */
.name-modal-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.name-change-content,
.name-history-content {
    padding: 0.25rem;
}

.name-change-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.name-target-summary {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.12), rgba(102, 126, 234, 0.12));
    border: 1px solid rgba(0, 188, 212, 0.2);
}

.name-target-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.name-target-id {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    font-family: "Consolas", "SFMono-Regular", "Liberation Mono", monospace;
    word-break: break-all;
}

.name-target-secondary {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.82rem;
    word-break: break-all;
}

.name-input-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.name-input-label-row label {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    font-weight: 600;
}

.name-history-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid rgba(0, 188, 212, 0.28);
    border-radius: 999px;
    background: rgba(0, 188, 212, 0.12);
    color: #00bcd4;
    cursor: pointer;
    transition: background-color 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

.name-history-trigger:hover,
.name-history-trigger:focus-visible {
    background: rgba(0, 188, 212, 0.2);
    border-color: rgba(0, 188, 212, 0.4);
    transform: translateY(-1px);
}

.name-input-box.e-control-wrapper,
.name-input-box.e-input-group {
    width: 100%;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.26);
    border: 1px solid rgba(0, 188, 212, 0.18);
}

.name-input-box.e-control-wrapper input,
.name-input-box.e-input-group input {
    color: #ffffff;
    font-size: 1rem;
}

.name-input-help {
    color: rgba(255, 255, 255, 0.56);
    font-size: 0.82rem;
    line-height: 1.45;
}

.name-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.name-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.name-history-item {
    padding: 0.9rem 1rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 188, 212, 0.18);
}

.name-history-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.name-history-user {
    color: #ffffff;
    font-weight: 600;
}

.name-history-time {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.82rem;
}

.name-history-change,
.event-name-change {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.event-name-change {
    margin-top: 0.7rem;
}

.name-change-pill {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.84rem;
    line-height: 1.2;
    max-width: 100%;
    word-break: break-word;
}

.name-change-pill.previous {
    border-color: rgba(255, 152, 0, 0.3);
    background: rgba(255, 152, 0, 0.12);
    color: #ffd08a;
}

.name-change-pill.current {
    border-color: rgba(0, 188, 212, 0.3);
    background: rgba(0, 188, 212, 0.14);
    color: #7ae7f5;
}

/* ========== DEVICE OFFLINE INDICATOR ========== */
.live-monitor-container .device-offline-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(220, 53, 69, 0.25);
    border-radius: 4px;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 0.1rem;
    text-transform: uppercase;
    color: #ff4d4d;
    animation: pulse-offline 2s ease-in-out infinite;
}

.live-monitor-container .device-offline-indicator i {
    font-size: 1.4rem;
    color: #ff4d4d;
}

@keyframes pulse-offline {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* ========== MONITOR CONTROLS ========== */
.live-monitor-container .monitor-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: nowrap;
    min-width: 0;
    flex: 0 1 auto;
}

.live-monitor-container .header-command-panel {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
    min-width: 0;
    flex: 1 1 auto;
}

.live-monitor-container .battery-time-pill {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    min-height: 1.8rem;
    max-width: 100%;
    padding: 0.24rem 0.62rem;
    border: 1px solid rgba(0, 188, 212, 0.32);
    border-radius: 999px;
    background: rgba(0, 188, 212, 0.12);
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.78rem;
    line-height: 1;
    white-space: nowrap;
}

.live-monitor-container .battery-time-pill i {
    color: #00d8ff;
    font-size: 0.82rem;
}

.live-monitor-container .battery-time-label {
    color: rgba(255, 255, 255, 0.64);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.live-monitor-container .battery-time-value {
    color: #ffffff;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 0.88rem;
    font-weight: 700;
}

.live-monitor-container .battery-time-zone {
    color: #00d8ff;
    font-weight: 700;
}

.live-monitor-container .monitor-controls .e-btn {
    white-space: nowrap;
}

.live-monitor-container .device-header-icon-button {
    width: 2.35rem;
    height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 8px;
    border: 1px solid rgba(0, 188, 212, 0.26);
    background: rgba(0, 188, 212, 0.1);
    color: #00d8ff;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.live-monitor-container .device-header-icon-button:hover:not(:disabled),
.live-monitor-container .device-header-icon-button:focus-visible {
    background: rgba(0, 188, 212, 0.18);
    border-color: rgba(0, 188, 212, 0.5);
    color: #ffffff;
    transform: translateY(-1px);
}

.live-monitor-container .device-mute-toggle.is-muted {
    background: rgba(220, 53, 69, 0.16);
    border-color: rgba(220, 53, 69, 0.45);
    color: #ff5263;
}

.live-monitor-container .device-mute-toggle.is-muted:hover:not(:disabled),
.live-monitor-container .device-mute-toggle.is-muted:focus-visible {
    background: rgba(220, 53, 69, 0.24);
    border-color: rgba(220, 53, 69, 0.68);
    color: #ff6b7a;
}

.live-monitor-container .device-header-icon-button:disabled {
    cursor: wait;
    opacity: 0.72;
}

.live-monitor-container .device-header-icon-button i {
    font-size: 1rem;
    line-height: 1;
}

.live-monitor-container .device-emergency-btn {
    background: #dc3545 !important;
    border-color: #dc3545 !important;
    font-weight: 600;
}

.live-monitor-container .device-emergency-btn:hover {
    background: #c82333 !important;
    border-color: #c82333 !important;
    transform: scale(1.02);
}

.remote-access-dialog .lbsa-mobile-dialog-container {
    max-width: min(560px, calc(100vw - 1rem));
}

.remote-access-dialog-header {
    padding: 1rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(20, 26, 34, 0.98);
}

.remote-access-dialog-header h5 {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.94);
    font-size: 1.05rem;
    font-weight: 700;
}

.remote-access-dialog-header i {
    color: #00bcd4;
}

.remote-access-dialog-body {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    color: rgba(255, 255, 255, 0.88);
}

.remote-access-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(0, 188, 212, 0.22);
    border-radius: 8px;
    background: rgba(0, 188, 212, 0.08);
}

.remote-access-label {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.remote-access-value {
    min-width: 0;
    color: #ffffff;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.remote-access-notice {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.7rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(246, 173, 85, 0.32);
    border-radius: 8px;
    background: rgba(246, 173, 85, 0.1);
    color: rgba(255, 255, 255, 0.84);
    line-height: 1.45;
}

.remote-access-notice i {
    margin-top: 0.15rem;
    color: #f6ad55;
}

.remote-access-field {
    display: grid;
    gap: 0.45rem;
}

.remote-access-field label {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.82rem;
    font-weight: 700;
}

.remote-access-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ========== STATUS INDICATORS ========== */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.2);
}

.status-indicator.online {
    color: var(--color-success, #4caf50);
}

.status-indicator.offline {
    color: var(--color-danger, #f44336);
}

.tier-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: rgba(0, 188, 212, 0.2);
    color: #00bcd4;
    font-size: 0.875rem;
}

/* ========== STATS CARD ========== */
.stats-card {
    margin-bottom: 1rem;
    background: var(--bg-card, #2a2a2a);
    color: white;
}

.live-monitor-container .stats-card .stats-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 0;
}

.live-monitor-container .stats-card .stat-item {
    min-width: 0;
}

.live-monitor-container .stats-card .stat-item label {
    line-height: 1.15;
}

/* Directly switch from 6 columns to 3 columns around tablet/mobile widths */
@media (max-width: 800px) {
    .live-monitor-container .stats-card .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.35rem;
        margin-bottom: 0;
    }

    .live-monitor-container .stats-card .stat-item {
        padding: 0.3rem 0.35rem;
    }

    .live-monitor-container .stats-card .stat-item label {
        font-size: 0.58rem;
        margin-bottom: 0.12rem;
    }

    .live-monitor-container .stats-card .stat-item .stat-value {
        font-size: 0.75rem;
    }

    .live-monitor-container .stats-card .mobile-secondary-stat {
        display: none;
    }
}

.loading-card {
    background: var(--bg-card, #2a2a2a);
    color: white;
}

/* ========== BATTERY GRID ========== */
.battery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.live-monitor-container .battery-cluster-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(760px, 100%), 1fr));
    align-items: start;
    justify-items: center;
    gap: 1rem;
    width: 100%;
}

.live-monitor-container .battery-cluster-group {
    width: 100%;
    max-width: 960px;
    min-width: 0;
}

.battery-cluster-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem 0.75rem;
    margin-bottom: 0.75rem;
}

.battery-cluster-title {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #00bcd4;
    font-weight: 700;
}

.battery-cluster-count {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.86rem;
}

.battery-cluster-live-metrics {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-left: auto;
}

.battery-cluster-live-current,
.battery-cluster-live-power,
.battery-cluster-live-request,
.cluster-detail-current,
.cluster-detail-power,
.cluster-detail-request {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.75rem;
    padding: 0.18rem 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.battery-cluster-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.live-monitor-container .battery-cluster-group .battery-grid.battery-cluster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(350px, 100%), 1fr));
    justify-content: stretch;
    justify-items: center;
    align-items: stretch;
}

.live-monitor-container .battery-cluster-group .battery-card {
    width: 100%;
    min-width: 0;
    max-width: 450px;
    flex: initial;
}

.live-monitor-container .battery-cluster-list.summary-view {
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 280px));
    justify-content: center;
    justify-items: center;
}

.battery-cluster-summary-card {
    position: relative;
    width: 100%;
    max-width: 280px;
    min-width: 0;
    padding: 0.85rem 0.75rem 1rem;
    background: var(--bg-card, #2a2a2a);
    color: white;
    border: 1px solid rgba(0, 188, 212, 0.18);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.28);
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.battery-cluster-summary-card:hover,
.battery-cluster-summary-card:focus-visible {
    border-color: rgba(126, 214, 255, 0.64);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(126, 214, 255, 0.18);
    outline: none;
    transform: translateY(-1px);
}

.cluster-summary-live-metrics {
    position: absolute;
    inset: 0.58rem 0.62rem auto;
    z-index: 1;
    pointer-events: none;
}

.cluster-summary-live-current,
.cluster-summary-live-power {
    position: absolute;
    top: 0;
    display: inline-flex;
    align-items: center;
    min-height: 1.45rem;
    max-width: 5.8rem;
    padding: 0.16rem 0.42rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.22);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.cluster-summary-live-current {
    left: 0;
}

.cluster-summary-live-power {
    right: 0;
}

.cluster-live-value--positive {
    color: #6ee27b;
    border-color: rgba(110, 226, 123, 0.34);
}

.cluster-live-value--negative {
    color: #ff7d73;
    border-color: rgba(255, 82, 82, 0.38);
}

.cluster-live-value--neutral {
    color: rgba(255, 255, 255, 0.84);
}

.cluster-live-value--charge {
    color: #6ee27b;
    border-color: rgba(110, 226, 123, 0.34);
}

.cluster-live-value--discharge {
    color: #facc15;
    border-color: rgba(250, 204, 21, 0.38);
}

.battery-cluster-summary-card.cluster-summary-card--on {
    background: linear-gradient(180deg, rgba(76, 175, 80, 0.16), rgba(42, 42, 42, 0.96) 58%);
    border-color: rgba(76, 175, 80, 0.48);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(76, 175, 80, 0.12);
}

.battery-cluster-summary-card.cluster-summary-card--mixed {
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.18), rgba(42, 42, 42, 0.96) 58%);
    border-color: rgba(245, 158, 11, 0.52);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(245, 158, 11, 0.14);
}

.battery-cluster-summary-card.cluster-summary-card--off {
    background: linear-gradient(180deg, rgba(244, 67, 54, 0.16), rgba(42, 42, 42, 0.96) 58%);
    border-color: rgba(244, 67, 54, 0.52);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(244, 67, 54, 0.13);
}

.cluster-summary-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    color: #00bcd4;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    min-height: 1.45rem;
    padding: 0 4.6rem;
}

.cluster-summary-chart {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(220px, 100%);
    aspect-ratio: 1;
    margin: 0 auto;
}

.cluster-summary-chart .mud-chart,
.cluster-summary-chart svg {
    width: 100% !important;
    height: 100% !important;
}

.cluster-summary-center {
    position: absolute;
    inset: 24%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.34rem;
    text-align: center;
    pointer-events: none;
}

.cluster-summary-soc {
    color: rgba(255, 255, 255, 0.94);
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1;
}

.cluster-summary-counts {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.1rem;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
}

.cluster-summary-total {
    color: rgba(255, 255, 255, 0.95);
}

.cluster-summary-online {
    color: #6ee27b;
}

.cluster-summary-off {
    color: #ff5252;
}

.cluster-summary-actions-btn.lbsa-mud-button,
.cluster-summary-actions-btn {
    min-width: 5.4rem;
    min-height: 1.95rem;
    padding: 0 0.6rem !important;
    border-radius: 6px;
    border: 1px solid rgba(0, 188, 212, 0.38) !important;
    background: rgba(0, 188, 212, 0.13) !important;
    color: #7ed6ff !important;
    pointer-events: auto;
}

.cluster-summary-actions-btn i {
    margin-right: 0.35rem;
}

.cluster-summary-actions-slot {
    pointer-events: auto;
}

/* ========== CELL GRID STYLES ========== */
.cell-voltages {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.cell-voltages label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.cell-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}

.cell-item {
    padding: 0.25rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    text-align: center;
    border: 1px solid transparent;
}

.cell-item.warning {
    border-color: var(--color-warning, #ff9800);
    color: var(--color-warning, #ff9800);
}

.cell-item.danger {
    border-color: var(--color-danger, #f44336);
    color: var(--color-danger, #f44336);
}

.cell-number {
    display: block;
    font-size: 0.75rem;
    opacity: 0.7;
}

.cell-voltage {
    display: block;
    font-size: 0.875rem;
    font-weight: bold;
}

/* ========== ERROR STATUS ========== */
.error-status {
    padding: 0.5rem;
    background: rgba(var(--color-danger-rgb, 244, 67, 54), 0.2);
    border: 1px solid var(--color-danger, #f44336);
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.error-status.clickable {
    cursor: pointer;
}

.error-status.clickable:hover {
    background: rgba(var(--color-danger-rgb, 244, 67, 54), 0.3);
    transform: translateX(2px);
}

/* ========== MODAL STYLES ========== */
.modal-header-custom {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.module-content {
    max-width: 100%;
    overflow: hidden;
    padding: 0.5rem;
}

.modal-footer-custom {
    display: flex;
    justify-content: flex-end;
    padding: 1rem;
}

.error-details-content {
    padding: 1rem;
}

.error-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ========== MUTE OPTIONS MODAL ========== */
.mute-options-content {
    padding: 1.5rem;
}

.mute-options-content p {
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
}

.mute-options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.mute-options-grid .e-btn {
    padding: 0.75rem;
    justify-content: center;
    font-size: 1rem;
}

.mute-options-grid .e-btn i {
    margin-right: 0.5rem;
}

/* ========== NOTIFICATION SETTINGS ========== */
.notification-settings-content {
    padding: 1rem;
    height: 100%;
    overflow-y: auto;
}

.device-notification-settings {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.settings-info {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(0, 188, 212, 0.05);
    border-left: 3px solid #00bcd4;
    border-radius: 4px;
}

.settings-section {
    background: rgba(255, 255, 255, 0.02);
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 188, 212, 0.1);
}

.settings-section h4 {
    color: #00bcd4;
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.setting-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item label {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    font-size: 0.95rem;
}

.setting-item input[type="checkbox"] {
    margin-right: 0.75rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #00bcd4;
}

.settings-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.settings-actions .e-btn {
    padding: 0.5rem 1.5rem;
}

/* ========== ERROR ITEMS ========== */
.error-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    border-left: 4px solid #ffc107;
}

.error-item.severity-high {
    border-left-color: #dc3545;
    background: #fff5f5;
}

.error-item.severity-medium {
    border-left-color: #ffc107;
    background: #fffbf0;
}

.error-item.severity-low {
    border-left-color: #17a2b8;
    background: #f0f8ff;
}

.error-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.error-info {
    flex: 1;
}

.error-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.error-description {
    font-size: 0.875rem;
    color: #6c757d;
}

.badge-active {
    background: #dc3545;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.no-errors {
    text-align: center;
    padding: 2rem;
}

.no-errors i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* ========== NO DETAIL DATA ========== */
.no-detail-data {
    padding: 1rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    color: #a0aec0;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.no-detail-data i {
    font-size: 1rem;
}

/* ========== CELL INFO GRID ========== */
.cell-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
}

.cell-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cell-info label {
    font-size: 0.75rem;
    opacity: 0.7;
}

.cell-info span {
    font-size: 0.9rem;
    font-weight: 600;
}

/* ========== CONTACTOR STATUS ========== */
.contactor-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0.25rem;
    margin-top: 0.5rem;
}

.contactor-status label {
    font-size: 0.85rem;
    opacity: 0.7;
}

.contactor-status span {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.2);
}

.limiting-current {
    color: #17a2b8;
    font-weight: bold;
    padding: 0.25rem 0.5rem;
    background: rgba(23, 162, 184, 0.1);
    border-radius: 0.25rem;
}

.text-orange {
    color: #ed8936;
}

/* ========== MODULE VIEW ========== */
.module-view-button {
    margin-top: 1rem;
}

.modules-card-container {
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: max-content;
    gap: 1rem;
    padding: 0.5rem;
    height: 450px;
    overflow-y: auto;
    overflow-x: hidden;
    align-content: start;
}

.module-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.module-content .modules-card-container {
    flex: 1;
    height: auto;
    max-height: 100%;
}

.module-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(0, 188, 212, 0.1);
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    overflow: hidden;
    max-height: 120px;
    height: auto;
}

.module-card:hover {
    background: rgba(0, 188, 212, 0.08);
    border-color: rgba(0, 188, 212, 0.3);
    transform: translateY(-2px);
}

.module-card.balancing {
    border-left: 3px solid #ffc107;
    background: rgba(255, 193, 7, 0.05);
}

.module-card.balancing:hover {
    background: rgba(255, 193, 7, 0.1);
}

/* Module Card Header */
.module-card-header {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: rgba(0, 188, 212, 0.05);
    border-bottom: 1px solid rgba(0, 188, 212, 0.1);
    padding-bottom: 9px;
}

.module-number {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #00bcd4;
    flex: 1;
}

.module-number i {
    font-size: 1rem;
}

.module-pack-voltage {
    font-size: 1.1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-right: 1rem;
}

.module-status {
    margin-right: 0.5rem;
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.ok {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.status-badge.balancing {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.status-badge.invalid {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.module-navigate {
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.2s ease;
}

.module-card:hover .module-navigate {
    color: #00bcd4;
    transform: translateX(3px);
}

/* Module Card Body */
.module-card-body {
    padding: 0.75rem;
}

.detail-values-single-line {
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    flex-wrap: wrap;
}

.detail-item {
    flex: 1;
    min-width: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.detail-sublabel {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.55rem;
    text-transform: uppercase;
}

.detail-value {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 6px;
}

.detail-item.highlight-max .detail-value {
    color: #f44336;
    font-weight: 600;
}

.detail-item.highlight-min .detail-value {
    color: #2196f3;
    font-weight: 600;
}

.detail-item.highlight-max-temp .detail-value {
    color: #ff9800;
    font-weight: 600;
}

.detail-item.highlight-min-temp .detail-value {
    color: #03a9f4;
    font-weight: 600;
}

/* ========== HIGHLIGHT CLASSES ========== */
.highlight-max {
    color: #f44336 !important;
    font-weight: 700;
    background: rgba(244, 67, 54, 0.1);
    padding: 0.15rem 0.3rem;
    border-radius: 0.2rem;
    position: relative;
}

.highlight-min {
    color: #2196f3 !important;
    font-weight: 700;
    background: rgba(33, 150, 243, 0.1);
    padding: 0.15rem 0.3rem;
    border-radius: 0.2rem;
    position: relative;
}

.highlight-max-temp {
    color: #ff9800 !important;
    font-weight: 700;
    background: rgba(255, 152, 0, 0.1);
    padding: 0.15rem 0.3rem;
    border-radius: 0.2rem;
}

.highlight-min-temp {
    color: #03a9f4 !important;
    font-weight: 700;
    background: rgba(3, 169, 244, 0.1);
    padding: 0.15rem 0.3rem;
    border-radius: 0.2rem;
}

/* Module Header */
.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.module-header h5 {
    margin: 0;
    font-size: 1rem;
}

.module-metrics .metric-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.module-metrics .metric-row:last-child {
    border-bottom: none;
}

/* ========== SKELETON STYLES ========== */
.module-card .e-skeleton {
    background: linear-gradient(
        90deg,
        rgba(0, 188, 212, 0.05) 0%,
        rgba(0, 188, 212, 0.1) 50%,
        rgba(0, 188, 212, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.module-card.skeleton {
    pointer-events: none;
    opacity: 0.7;
}

.module-card.skeleton .e-skeleton {
    background: linear-gradient(
        90deg,
        rgba(0, 188, 212, 0.05) 0%,
        rgba(0, 188, 212, 0.1) 50%,
        rgba(0, 188, 212, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ========== CELL DETAILS VIEW ========== */
.e-dialog.e-popup .e-dlg-content {
    display: flex;
    flex-direction: column;
    height: calc(100% - 60px);
    overflow: hidden;
}

.cell-details-container {
    padding: 1rem;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.live-monitor-container .loading-container {
    height: 350px;
}

/* Statistics Card */
.cell-stats-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(0, 188, 212, 0.1);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.cell-stats-card .cell-stats-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 0.55rem !important;
    margin-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.cell-stats-card .cell-stats-grid .stat-item {
    min-width: 0 !important;
    padding: 0.55rem 0.35rem;
    flex-direction: column;
    gap: 0.15rem;
    text-align: center;
}

.cell-stats-card .cell-stats-grid .stat-label {
    margin: 0 0 0.15rem;
    line-height: 1.1;
    white-space: nowrap;
}

.cell-stats-card .cell-stats-grid .stat-value {
    font-size: 0.82rem;
    line-height: 1.15;
    white-space: nowrap;
}

.stat-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.stat-value.text-warning {
    color: #ff9800;
}

.stat-value.text-info {
    color: #4299e1;
}

.stat-value.text-danger {
    color: #f44336;
}

.stat-value.text-success {
    color: #4caf50;
}

/* Cells Section */
.cells-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.live-monitor-container .section-title {
    color: #00bcd4;
    font-size: 0.85rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.live-monitor-container .section-title i {
    font-size: 1rem;
}

.cells-grid-modern {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    width: 100%;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    align-content: start;
}

.cell-card-modern {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(0, 188, 212, 0.1);
    border-radius: 4px;
    padding: 0.5rem;
    position: relative;
    transition: all 0.2s ease;
    cursor: default;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 60px;
}

.cell-card-modern:hover {
    background: rgba(0, 188, 212, 0.08);
    border-color: rgba(0, 188, 212, 0.3);
}

.cell-card-modern.is-highest {
    border: 2px solid rgba(244, 67, 54, 0.9) !important;
    background: rgba(244, 67, 54, 0.2) !important;
    box-shadow: 0 0 12px rgba(244, 67, 54, 0.4);
}

.cell-card-modern.is-lowest {
    border: 2px solid rgba(33, 150, 243, 0.9) !important;
    background: rgba(33, 150, 243, 0.2) !important;
    box-shadow: 0 0 12px rgba(33, 150, 243, 0.4);
}

.cell-main-line {
    display: flex;
    align-items: center;
    width: 100%;
}

.cell-left {
    width: 33.33%;
    text-align: left;
}

.cell-center {
    width: 33.33%;
    text-align: center;
}

.cell-right {
    width: 33.33%;
    text-align: right;
    min-height: 1rem;
}

.cell-id {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.65rem;
    font-weight: 600;
}

.balancing-icon {
    color: #ff9800;
    font-size: 0.6rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.voltage-value {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 500;
}

.cell-deviation {
    text-align: center;
    margin-top: 0.125rem;
    line-height: 5px;
}

.deviation-value {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.6rem;
    font-weight: 400;
}

.cell-card-modern.is-highest .deviation-value {
    color: rgba(244, 67, 54, 0.9);
}

.cell-card-modern.is-lowest .deviation-value {
    color: rgba(33, 150, 243, 0.9);
}

/* ========== TEMPERATURE SECTION ========== */
.temperature-section {
    margin-top: 1rem;
    flex-shrink: 0;
}

.temperature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.temperature-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(0, 188, 212, 0.1);
    border-radius: 4px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.2s ease;
    min-width: 0;
}

.temperature-card:hover {
    background: rgba(0, 188, 212, 0.08);
    border-color: rgba(0, 188, 212, 0.3);
}

.temperature-card.temp-normal {
    border-color: rgba(76, 175, 80, 0.3);
}

.temperature-card.temp-medium {
    border-color: rgba(255, 152, 0, 0.3);
}

.temperature-card.temp-high {
    border-color: rgba(244, 67, 54, 0.3);
    background: rgba(244, 67, 54, 0.05);
}

.temperature-card.temp-low {
    border-color: rgba(66, 153, 225, 0.3);
    background: rgba(66, 153, 225, 0.05);
}

.temp-info {
    flex: 1;
    min-width: 0;
}

.temp-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.temp-value {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 400;
}

/* ========== UPDATE STATUS ========== */
.update-status {
    margin-top: 0.75rem;
    padding: 0.375rem;
    background: rgba(0, 188, 212, 0.05);
    border: 1px solid rgba(0, 188, 212, 0.1);
    border-radius: 4px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.625rem;
    flex-shrink: 0;
}

.update-status i {
    margin-right: 0.25rem;
    color: #00bcd4;
    font-size: 0.625rem;
}

/* ========== NO DATA CONTAINER ========== */
.no-data-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: rgba(255, 255, 255, 0.5);
}

.no-data-container i {
    font-size: 4rem;
    color: rgba(0, 188, 212, 0.3);
    margin-bottom: 1rem;
}

.no-data-container h3 {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
    font-weight: 300;
}

.no-data-container p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
}

/* ========== SCROLLBAR STYLES ========== */
.modules-card-container::-webkit-scrollbar,
.cells-grid-modern::-webkit-scrollbar {
    width: 8px;
}

.modules-card-container::-webkit-scrollbar-track,
.cells-grid-modern::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.modules-card-container::-webkit-scrollbar-thumb,
.cells-grid-modern::-webkit-scrollbar-thumb {
    background: rgba(0, 188, 212, 0.3);
    border-radius: 4px;
}

.modules-card-container::-webkit-scrollbar-thumb:hover,
.cells-grid-modern::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 188, 212, 0.5);
}

/* ========== CELL SKELETON STYLES ========== */
.cell-skeleton-container {
    animation: fadeIn 0.3s ease-in;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cell-skeleton-container .e-skeleton {
    background: linear-gradient(
        90deg,
        rgba(0, 188, 212, 0.05) 0%,
        rgba(0, 188, 212, 0.15) 50%,
        rgba(0, 188, 212, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.stat-label-skeleton {
    margin-bottom: 0.5rem;
}

.stat-value-skeleton {
    margin: 0 auto;
}

.cell-skeleton {
    pointer-events: none;
}

.cell-skeleton .e-skeleton {
    margin: 0 auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.no-data {
    text-align: center;
    padding: 3rem;
    color: #718096;
}

.no-data i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* ========== EVENT HISTORY MODAL ========== */
.event-history-modal .e-dlg-content {
    padding: 0;
    background: #1a1a1a;
}

.event-history-content {
    padding: 1rem;
    max-height: calc(85vh - 120px);
    overflow-y: auto;
}

.events-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.event-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(0, 188, 212, 0.2);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.event-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(0, 188, 212, 0.4);
}

.event-item.battery-event {
    border-left: 3px solid #00bcd4;
}

.event-item.system-event {
    border-left: 3px solid #667eea;
}

.event-item.warning-event {
    border-left: 3px solid #ff9800;
}

.event-icon {
    font-size: 1.5rem;
    color: #00bcd4;
    min-width: 32px;
    text-align: center;
}

.event-details {
    flex: 1;
    min-width: 0;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 1rem;
}

.event-category {
    font-weight: 600;
    color: #00bcd4;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.event-time {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    white-space: nowrap;
}

.event-message {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    line-height: 1.5;
}

.event-details-text {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.6);
    font-family: monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
}

.event-name-change + .event-details-text {
    font-family: inherit;
}

.event-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.event-badge.info {
    background: rgba(0, 188, 212, 0.2);
    color: #00bcd4;
}

.event-badge.warning {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
}

.event-badge.error {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

/* ========== OTA PROGRESS RIBBON ========== */
.ota-progress-ribbon {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(0, 188, 212, 0.1);
    border-top: 1px solid rgba(0, 188, 212, 0.2);
    margin-top: 12px;
    border-radius: 0 0 4px 4px;
    font-size: 0.75rem;
    font-family: monospace;
}

.ota-progress-ribbon span {
    padding: 2px 6px;
    border-radius: 3px;
}

.progress-idle {
    color: rgba(255, 255, 255, 0.4);
}

.progress-downloading {
    background: rgba(33, 150, 243, 0.3);
    color: #64b5f6;
}

.progress-complete {
    background: rgba(76, 175, 80, 0.3);
    color: #81c784;
}

.progress-error {
    background: rgba(244, 67, 54, 0.3);
    color: #e57373;
}

.progress-verifying {
    background: rgba(255, 152, 0, 0.3);
    color: #ffb74d;
}

/* ========== FIRMWARE VERSION MODAL ========== */
.firmware-version-content {
    padding: 1rem;
}

.firmware-info-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.firmware-row {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(0, 188, 212, 0.1);
    border-radius: 6px;
    gap: 1rem;
}

.firmware-row.update-available {
    border-color: rgba(76, 175, 80, 0.3);
    background: rgba(76, 175, 80, 0.05);
}

.firmware-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #00bcd4;
    font-weight: 500;
}

.firmware-type i {
    font-size: 1.1rem;
}

.hw-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: rgba(0, 188, 212, 0.15);
    border: 1px solid rgba(0, 188, 212, 0.3);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    margin-left: 0.25rem;
}

.firmware-versions {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.current-version,
.available-version {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.version-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    min-width: 60px;
}

.version-value {
    color: rgba(255, 255, 255, 0.9);
    font-family: monospace;
    font-size: 0.9rem;
}

.version-value.update {
    color: #4caf50;
    font-weight: 500;
}

.firmware-status {
    display: flex;
    justify-content: center;
}

.firmware-status .status-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.firmware-status .status-badge.current {
    background: rgba(0, 188, 212, 0.15);
    color: #00bcd4;
}

.firmware-status .status-badge.update {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.firmware-summary {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 188, 212, 0.1);
}

.summary-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.summary-message.current {
    background: rgba(0, 188, 212, 0.1);
    color: #00bcd4;
}

.summary-message.update {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
}

.summary-message.fallback {
    background: rgba(255, 152, 0, 0.1);
    color: #ff9800;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
}

.summary-message.info {
    background: rgba(0, 188, 212, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
}

.summary-message i {
    font-size: 1.25rem;
}

.hardware-info {
    display: flex;
    justify-content: space-between;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

.no-version-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.6);
}

.no-version-info i {
    font-size: 2rem;
    color: #00bcd4;
}

.version-hint {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    margin: 0;
}

/* ========== UPDATE GROUP MODAL ========== */
.update-group-content {
    padding: 1.5rem;
}

.update-group-content p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
}

.update-group-select {
    margin-bottom: 1rem;
}

.update-group-dropdown {
    width: 100%;
}

.update-group-info {
    background: rgba(0, 188, 212, 0.05);
    padding: 1rem;
    border-radius: 6px;
    border-left: 3px solid #00bcd4;
}

.update-group-info p {
    margin-bottom: 0.75rem;
}

.group-descriptions {
    list-style: none;
    padding: 0;
    margin: 0;
}

.group-descriptions li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.group-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.group-badge.main {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.group-badge.alpha {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.group-badge.beta {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

/* Update Group Button Colors */
.update-group-main {
    background: rgba(76, 175, 80, 0.15) !important;
    border-color: #4caf50 !important;
    color: #4caf50 !important;
}

.update-group-main:hover {
    background: rgba(76, 175, 80, 0.25) !important;
}

.update-group-alpha {
    background: rgba(244, 67, 54, 0.15) !important;
    border-color: #f44336 !important;
    color: #f44336 !important;
}

.update-group-alpha:hover {
    background: rgba(244, 67, 54, 0.25) !important;
}

.update-group-beta {
    background: rgba(255, 193, 7, 0.15) !important;
    border-color: #ffc107 !important;
    color: #ffc107 !important;
}

.update-group-beta:hover {
    background: rgba(255, 193, 7, 0.25) !important;
}

.update-group-unknown {
    background: rgba(158, 158, 158, 0.15) !important;
    border-color: #9e9e9e !important;
    color: #9e9e9e !important;
}

.update-group-unknown:hover {
    background: rgba(158, 158, 158, 0.25) !important;
}

/* ========== CAN LOG GRAPH MODAL ========== */
.can-log-graph-modal .e-dlg-content {
    padding: 0;
    background: #1a1a1a;
}

.can-log-graph-content {
    padding: 1rem;
    max-height: calc(85vh - 120px);
    overflow-y: auto;
}

.graph-controls-can {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.can-log-graph-skeleton {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.graph-controls-can--skeleton {
    align-items: center;
}

.refresh-btn-can {
    background: transparent !important;
    border: 1px solid rgba(0, 188, 212, 0.3) !important;
    color: #00bcd4 !important;
}

.refresh-btn-can:hover {
    background: rgba(0, 188, 212, 0.1) !important;
    border-color: rgba(0, 188, 212, 0.5) !important;
}

.back-projected-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: rgba(76, 175, 80, 0.9);
    background: rgba(76, 175, 80, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.chart-wrapper-can {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(0, 188, 212, 0.1);
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.can-chart-skeleton-block {
    border-radius: 6px;
    overflow: hidden;
}

.can-statistics-panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(0, 188, 212, 0.1);
    border-radius: 4px;
    padding: 1rem;
}

.can-statistics-panel h4 {
    color: #00bcd4;
    margin: 0 0 1rem 0;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.can-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.can-stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.can-stat-skeleton-item {
    gap: 0.45rem;
}

.can-stat-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.can-stat-value {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 400;
}

.can-log-btn {
    border-color: rgba(0, 188, 212, 0.3) !important;
}

.can-log-btn:hover {
    background: rgba(0, 188, 212, 0.1) !important;
    border-color: rgba(0, 188, 212, 0.5) !important;
}

/* ========== RESPONSIVE STYLES ========== */

/* Large screens - show cards side by side */
@media (min-width: 768px) {
    .modules-card-container {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        grid-auto-rows: max-content;
        align-content: start;
    }
}

/* Responsive adjustments for battery cards */
@media (max-width: 1200px) {
    .battery-card {
        flex: 0 1 350px;
        min-width: 350px;
        max-width: 400px;
    }
}

@media (max-width: 900px) {
    .battery-card {
        flex: 1 1 100%;
        min-width: 300px;
        max-width: 100%;
    }

    .live-monitor-container .header-content {
        gap: 0.6rem;
    }

    .live-monitor-container .header-text h1 {
        font-size: 1.45rem;
    }

    .sentinel-name-swap {
        max-width: min(82vw, 34ch);
    }

    .live-monitor-container .header-actions-row {
        align-items: center;
        gap: 0.65rem;
    }

    .live-monitor-container .monitor-controls {
        gap: 0.55rem;
        flex-wrap: wrap;
    }

    .live-monitor-container .header-command-panel {
        gap: 0.35rem;
    }
}

/* Below 768px - fullscreen modals and single column */
@media (max-width: 767px) {
    .live-monitor-container .header-card > .e-card-content {
        padding: 0.65rem 0.75rem !important;
    }

    .live-monitor-container .header-content {
        gap: 0.55rem;
    }

    .live-monitor-container .header-title-row {
        align-items: flex-start;
        gap: 0.55rem;
    }

    .live-monitor-container .bluetooth-direct-indicator {
        width: 2rem;
        height: 2rem;
    }

    .live-monitor-container .bluetooth-direct-indicator i {
        font-size: 1.08rem;
    }

    .live-monitor-container .header-actions-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.55rem;
    }

    .live-monitor-container .btn-back {
        justify-self: start;
        align-self: flex-start;
        min-width: 0;
        padding: 0.45rem 0.7rem !important;
    }

    .live-monitor-container .btn-back span {
        white-space: nowrap;
    }

    .live-monitor-container .header-text h1.live-monitor-title {
        font-size: 1.15rem;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "icon label"
            "name name";
        align-items: center;
        column-gap: 0.45rem;
        row-gap: 0.25rem;
        width: 100%;
        flex-wrap: nowrap;
    }

    .live-monitor-container .live-monitor-title-icon {
        grid-area: icon;
        font-size: 0.95rem;
    }

    .live-monitor-container .live-monitor-title-label {
        grid-area: label;
        min-width: 0;
        font-size: 0.72rem;
        line-height: 1;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        opacity: 0.86;
    }

    .live-monitor-container .header-text h1 .editable-identity {
        grid-area: name;
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.4rem;
        min-width: 0;
    }

    .sentinel-name-swap {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .live-monitor-container .editable-name-primary,
    .live-monitor-container .editable-name-secondary {
        display: block;
        width: 100%;
    }

    .live-monitor-container .header-edit-name-trigger {
        justify-self: end;
        width: 1.9rem;
        height: 1.9rem;
    }

    .live-monitor-container .monitor-controls {
        width: 100%;
        justify-content: stretch;
        gap: 0.5rem;
    }

    .live-monitor-container .header-command-panel {
        align-items: stretch;
        width: 100%;
    }

    .live-monitor-container .battery-time-pill {
        justify-content: center;
        width: 100%;
        border-radius: 8px;
    }

    .live-monitor-container .monitor-controls .e-btn {
        flex: 1 1 150px;
    }

    .live-monitor-container .device-header-icon-button {
        flex: 0 0 2.35rem;
    }

    .live-monitor-container .device-offline-indicator {
        justify-self: end;
        align-self: center;
        font-size: 0.78rem;
        padding: 0.35rem 0.55rem;
        gap: 0.3rem;
        letter-spacing: 0.06rem;
        white-space: nowrap;
    }

    .live-monitor-container .device-offline-indicator i {
        font-size: 0.9rem;
    }

    .name-modal-footer {
        width: 100%;
    }

    .name-modal-footer .e-btn {
        flex: 1 1 0;
    }

    .name-history-item-header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Module modal fullscreen */
    .module-view-modal.e-dialog.e-dlg-modal {
        width: 100% !important;
        height: 100dvh !important;
        max-width: 100% !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        border-radius: 0 !important;
    }

    .module-view-modal .e-dlg-content {
        height: calc(100dvh - 60px) !important;
        padding: 0 !important;
    }

    .module-view-modal .e-dlg-header {
        padding: 0.5rem !important;
        min-height: 40px !important;
    }

    .module-view-modal .e-dlg-header-content {
        font-size: 0.875rem !important;
    }

    .module-view-modal .module-content {
        height: 100%;
    }

    .module-view-modal .modules-card-container {
        height: 100%;
        max-height: 100%;
    }
}

/* Media queries for temperature grid */
@media (max-width: 768px) {
    .temperature-grid {
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .temperature-card {
        padding: 0.5rem;
        flex-direction: column;
        text-align: center;
    }

    .temp-info {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .temp-label {
        font-size: 0.625rem;
    }

    .temp-value {
        font-size: 0.75rem;
    }

    /* Optimize cells grid for tablets */
    .cells-grid-modern {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .cell-card-modern {
        padding: 0.4rem;
        min-height: 55px;
    }

    .voltage-value {
        font-size: 0.8rem;
    }

    .deviation-value {
        font-size: 0.55rem;
    }

    /* Make stats more compact */
    .cell-stats-card {
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.75rem;
    }

    .stat-item {
        padding: 0.25rem;
    }

    .stat-label {
        font-size: 0.625rem;
    }

    .stat-value {
        font-size: 0.875rem;
    }

}

@media (max-width: 480px) {
    .temperature-grid {
        gap: 0.25rem;
        padding: 0.5rem;
    }

    .temperature-card {
        padding: 0.4rem;
    }

    .temp-label {
        font-size: 0.5rem;
        white-space: nowrap;
    }

    .temp-value {
        font-size: 0.625rem;
    }

    /* Cell modal fullscreen on mobile */
    .cell-view-modal.e-dialog.e-dlg-modal {
        width: 100% !important;
        height: 100dvh !important;
        max-width: 100% !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        border-radius: 0 !important;
    }

    .cell-view-modal .e-dlg-content {
        height: calc(100dvh - 60px) !important;
        padding: 0 !important;
    }

    .cell-view-modal .e-dlg-header {
        padding: 0.5rem !important;
        min-height: 40px !important;
    }

    .cell-view-modal .e-dlg-header-content {
        font-size: 0.875rem !important;
    }

    /* Optimize cell details container for mobile */
    .cell-details-container {
        padding: 0.5rem;
        height: 100%;
    }

    /* Make cells grid 3 columns on mobile */
    .cells-grid-modern {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.35rem;
        padding: 0.5rem;
    }

    .cell-card-modern {
        padding: 0.35rem;
        min-height: 48px;
    }

    .cell-id {
        font-size: 0.55rem;
    }

    .voltage-value {
        font-size: 0.7rem;
    }

    .balancing-icon {
        font-size: 0.5rem;
    }

    .cell-deviation {
        margin-top: 0.05rem;
    }

    .deviation-value {
        font-size: 0.5rem;
    }

    /* Ultra compact stats on mobile */
    .cell-stats-card {
        padding: 0.4rem 0.5rem;
        margin-bottom: 0.5rem;
    }

    .stat-label {
        font-size: 0.55rem;
        margin-bottom: 0.125rem;
    }

    .stat-value {
        font-size: 0.75rem;
    }

    .live-monitor-container .stats-card .stats-grid {
        gap: 0.25rem;
    }

    .live-monitor-container .stats-card .stat-item {
        padding: 0.25rem 0.3rem;
    }

    .live-monitor-container .stats-card .stat-item label {
        font-size: 0.52rem;
    }

    .live-monitor-container .stats-card .stat-item .stat-value {
        font-size: 0.7rem;
    }

    /* Smaller section titles */
    .section-title {
        font-size: 0.875rem;
        padding: 0.4rem;
        margin-bottom: 0.5rem;
    }

    .section-title i {
        font-size: 0.75rem;
    }

    /* Update status smaller */
    .update-status {
        font-size: 0.625rem;
        padding: 0.4rem;
        margin-top: 0.5rem;
    }

    /* Small screen optimizations for modules */
    .modules-card-container {
        padding: 0.25rem;
        gap: 0.5rem;
    }

    .module-card-header {
        padding: 0.5rem;
    }

    .module-number {
        font-size: 0.875rem;
    }

    .module-number i {
        font-size: 0.875rem;
    }

    .module-pack-voltage {
        font-size: 1rem;
    }

    .status-badge {
        font-size: 0.6rem;
        padding: 0.2rem 0.4rem;
    }

    .module-card-body {
        padding: 0.5rem;
    }

    .detail-values-single-line {
        gap: 0.4rem;
    }

    .detail-item {
        min-width: 45px;
        padding: 0.2rem;
    }

    .detail-sublabel {
        font-size: 0.5rem;
    }

    .detail-value {
        font-size: 0.7rem;
    }
}

/* Ultra-small devices (phones in landscape) */
@media (max-width: 640px) and (orientation: landscape) {
    .cells-grid-modern {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.35rem;
    }

    .cell-card-modern {
        padding: 0.3rem;
        min-height: 45px;
    }

    .voltage-value {
        font-size: 0.65rem;
    }

    .cell-id {
        font-size: 0.5rem;
    }

    .deviation-value {
        font-size: 0.45rem;
    }

    .balancing-icon {
        font-size: 0.45rem;
    }
}

/* ========== FLOATING ACTION BUTTON & SIDEBAR ========== */
.floating-toggle-btn-monitor {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 998;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(80, 80, 80, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    font-size: 1.25rem;
}

.floating-toggle-btn-monitor:hover {
    background: rgba(100, 100, 100, 0.95);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
}

.floating-toggle-btn-monitor:active {
    transform: scale(0.95);
}

/* Sidebar Styles */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(0, 188, 212, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.sidebar-content {
    padding: 0.75rem 0;
}

.sidebar-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-menu-item:hover {
    background: rgba(0, 188, 212, 0.08);
    border-left-color: #00bcd4;
}

.sidebar-menu-item:active {
    background: rgba(0, 188, 212, 0.15);
}

.sidebar-menu-item i:first-child {
    font-size: 1.1rem;
    color: #00bcd4;
    width: 24px;
    text-align: center;
}

.sidebar-menu-item span {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 400;
}

.sidebar-menu-item-toggle {
    cursor: pointer;
}

.sidebar-toggle-control {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 3.2rem;
}

.sidebar-item-arrow {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.sidebar-menu-item:hover .sidebar-item-arrow {
    color: rgba(255, 255, 255, 0.5);
    transform: translateX(3px);
}

.sidebar-menu-item.warning {
    color: #ff9800;
}

.sidebar-menu-item.warning i:first-child {
    color: #ff9800;
}

.sidebar-menu-item.warning:hover {
    background: rgba(255, 152, 0, 0.08);
    border-left-color: #ff9800;
}

/* ========== CLUSTER SUMMARY ACTIONS ========== */
.cluster-actions-dialog .e-dlg-content {
    background: #1f1f1f;
}

.cluster-actions-content {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.cluster-actions-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.82rem;
}

.cluster-actions-meta strong {
    color: rgba(255, 255, 255, 0.96);
    font-size: 1.05rem;
}

.cluster-actions-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
}

.cluster-actions-dialog .cluster-action-menu-btn.lbsa-mud-button,
.cluster-actions-dialog .cluster-action-menu-btn {
    width: 100%;
    min-height: 2.65rem;
    justify-content: flex-start;
    gap: 0.65rem;
    border-radius: 6px;
}

.cluster-actions-dialog .cluster-action-menu-btn i {
    width: 1.2rem;
    text-align: center;
}

/* ========== CLUSTER BATTERY DETAIL ========== */
.cluster-detail-dialog .e-dlg-content {
    background: #1f1f1f;
}

.cluster-detail-content {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    min-height: 100%;
}

.cluster-detail-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
}

.cluster-detail-count {
    display: inline-flex;
    align-items: baseline;
    gap: 0.1rem;
    margin-right: auto;
    font-size: 1rem;
    font-weight: 800;
}

.cluster-detail-grid.battery-grid.battery-cluster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(350px, 100%), 1fr));
    justify-content: stretch;
    justify-items: center;
    align-items: stretch;
    width: 100%;
}

.cluster-detail-dialog .battery-card {
    width: 100%;
    min-width: 0;
    max-width: 450px;
    flex: initial;
}

.cluster-detail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 16rem;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.72);
    text-align: center;
}

.cluster-detail-empty i {
    color: rgba(255, 255, 255, 0.35);
    font-size: 2.25rem;
}

/* ========== CLUSTER ENERGY METRICS ========== */
.cluster-energy-btn.e-btn,
.cluster-energy-btn.lbsa-btn,
.cluster-energy-btn.lbsa-mud-button,
.cluster-energy-btn {
    color: #7ed6ff !important;
    border-color: rgba(126, 214, 255, 0.35) !important;
    background: rgba(126, 214, 255, 0.1) !important;
}

.cluster-energy-modal .e-dlg-content {
    background: #1f1f1f;
}

.cluster-energy-header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.cluster-energy-header i {
    color: #7ed6ff;
}

.cluster-energy-header span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cluster-energy-content {
    display: grid;
    gap: 1rem;
    min-height: 100%;
}

.cluster-energy-loading,
.cluster-energy-empty {
    min-height: 360px;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.72);
    text-align: center;
}

.cluster-energy-empty {
    gap: 0.75rem;
}

.cluster-energy-empty i {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.32);
}

.cluster-energy-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cluster-energy-range-controls,
.cluster-energy-date-controls,
.cluster-energy-day-nav {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.cluster-energy-range-controls {
    flex-wrap: wrap;
}

.cluster-energy-date-controls {
    flex: 1 1 360px;
    justify-content: center;
}

.cluster-energy-day-nav {
    padding: 0.2rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
}

.cluster-energy-nav-btn.lbsa-mud-button,
.cluster-energy-today-btn.lbsa-mud-button {
    min-width: 34px;
    min-height: 34px;
    padding: 0.35rem 0.55rem;
}

.cluster-energy-today-btn.lbsa-mud-button {
    gap: 0.4rem;
    color: rgba(255, 255, 255, 0.9);
}

.cluster-energy-date-picker {
    width: 170px;
}

.cluster-energy-date-picker .mud-input-control,
.cluster-energy-date-picker .mud-input-control-input-container,
.cluster-energy-date-picker .mud-input {
    min-height: 40px;
}

.cluster-energy-date-picker .mud-input {
    background: rgba(255, 255, 255, 0.055);
    border-radius: 7px;
}

.cluster-energy-date-picker input.mud-input-root {
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.86rem;
}

.cluster-energy-date-picker .mud-input-label,
.cluster-energy-date-picker .mud-input-adornment,
.cluster-energy-date-picker .mud-icon-button {
    color: rgba(255, 255, 255, 0.68);
}

.cluster-energy-date-picker .mud-input-outlined-border {
    border-color: rgba(126, 214, 255, 0.22);
}

.cluster-energy-date-picker .mud-input:hover .mud-input-outlined-border,
.cluster-energy-date-picker .mud-input:focus-within .mud-input-outlined-border {
    border-color: rgba(126, 214, 255, 0.52);
}

.cluster-energy-controls .e-control-wrapper,
.cluster-energy-controls .e-input-group {
    max-width: 230px;
}

.cluster-energy-axis-strip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    padding: 0.55rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.18);
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.82rem;
}

.cluster-energy-axis-strip span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    white-space: nowrap;
}

.cluster-energy-axis-strip strong {
    color: #7ed6ff;
    font-size: 0.72rem;
    letter-spacing: 0;
    text-transform: uppercase;
}

.cluster-energy-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.cluster-energy-kpi {
    display: grid;
    gap: 0.2rem;
    padding: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.055);
}

.cluster-energy-kpi span {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.cluster-energy-kpi strong {
    color: rgba(255, 255, 255, 0.96);
    font-size: 1.25rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.cluster-energy-kpi--in strong {
    color: #22c55e;
}

.cluster-energy-kpi--out strong {
    color: #ef4444;
}

.cluster-energy-kpi--soc strong {
    color: #fbbf24;
}

.cluster-energy-kpi--tou {
    border-color: rgba(251, 191, 36, 0.18);
}

.cluster-energy-kpi--tou.is-active {
    background: rgba(251, 191, 36, 0.08);
}

.cluster-energy-kpi--tou.is-active strong {
    color: #fbbf24;
}

.cluster-energy-chart {
    min-height: 430px;
}

.cluster-energy-range-navigator {
    margin-top: 12px;
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
    .floating-toggle-btn-monitor {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .live-monitor-sidebar.e-sidebar {
        width: 100% !important;
    }

    .sidebar-menu-item {
        padding: 1.25rem 1.5rem;
    }

    .sidebar-menu-item span {
        font-size: 1rem;
    }

    .cluster-energy-summary {
        grid-template-columns: 1fr;
    }

    .cluster-energy-controls {
        align-items: stretch;
    }

    .cluster-energy-range-controls,
    .cluster-energy-date-controls,
    .cluster-energy-day-nav {
        width: 100%;
    }

    .cluster-energy-date-controls {
        display: grid;
        grid-template-columns: 1fr;
    }

    .cluster-energy-controls .e-control-wrapper,
    .cluster-energy-controls .e-input-group,
    .cluster-energy-controls .refresh-btn-can,
    .cluster-energy-date-picker {
        width: 100%;
        max-width: none;
    }

    .cluster-energy-controls .refresh-btn-can {
        justify-content: center;
    }
}

/* Dense live-monitor composition: more batteries per viewport without hiding data. */
.live-monitor-container {
    padding: 0.7rem;
    padding-bottom: 5rem;
}

.live-monitor-container .header-card {
    margin-bottom: 0.7rem;
}

.live-monitor-container .battery-cluster-list,
.live-monitor-container .battery-grid {
    gap: 0.7rem;
}

.live-monitor-container .battery-cluster-header {
    gap: 0.35rem 0.6rem;
    margin-bottom: 0.45rem;
}

.live-monitor-container .battery-cluster-group .battery-grid.battery-cluster-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr));
}

.live-monitor-container .battery-cluster-group .battery-card {
    max-width: 410px !important;
}

.live-monitor-container .battery-cluster-list.summary-view {
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 250px));
}

.live-monitor-container .battery-cluster-summary-card {
    max-width: 250px;
    padding: 0.65rem 0.62rem 0.72rem;
}

.live-monitor-container .cluster-summary-chart {
    width: min(190px, 100%);
}

.cluster-detail-content {
    gap: 0.6rem;
}

.cluster-detail-meta {
    gap: 0.4rem;
    padding: 0.5rem 0.6rem;
}

.cluster-detail-grid.battery-grid.battery-cluster-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr));
}

.cluster-detail-dialog .battery-card {
    max-width: 410px;
}

@media (max-width: 640px) {
    .live-monitor-container {
        padding: 0.45rem;
        padding-bottom: 4.5rem;
    }

    .live-monitor-container .header-card {
        margin-bottom: 0.5rem;
    }

    .live-monitor-container .battery-cluster-list,
    .live-monitor-container .battery-grid {
        gap: 0.5rem;
    }

    .live-monitor-container .battery-cluster-group .battery-grid.battery-cluster-grid,
    .cluster-detail-grid.battery-grid.battery-cluster-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Cluster-owned AUX 485 VSD workflow */
.vsd-discovery-strip,
.cluster-vsd-section {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 0.85rem;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(20, 32, 52, 0.78));
}

.vsd-discovery-stage {
    display: grid;
    grid-template-rows: 0fr;
    margin-bottom: 0;
    opacity: 0;
    transform: translateY(-0.65rem) scale(0.985);
    transform-origin: top center;
    transition:
        grid-template-rows 360ms cubic-bezier(0.22, 1, 0.36, 1),
        margin-bottom 360ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 220ms ease,
        transform 360ms cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0s linear 360ms;
    visibility: hidden;
}

.vsd-discovery-stage.is-visible {
    grid-template-rows: 1fr;
    margin-bottom: 0.85rem;
    opacity: 1;
    transform: translateY(0) scale(1);
    transition-delay: 0s;
    visibility: visible;
}

.vsd-discovery-stage.is-hidden {
    pointer-events: none;
}

.vsd-discovery-stage__inner {
    min-height: 0;
    overflow: hidden;
}

.vsd-discovery-strip {
    margin: 0;
    padding: 0.8rem;
    transition: border-color 220ms ease, box-shadow 220ms ease, background 220ms ease;
}

.vsd-discovery-strip.is-scanning {
    border-color: rgba(45, 212, 191, 0.48);
    background:
        radial-gradient(circle at 8% 50%, rgba(20, 184, 166, 0.14), transparent 26%),
        linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(15, 42, 51, 0.84));
    box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.06), 0 12px 30px rgba(2, 8, 23, 0.16);
}

.vsd-discovery-strip.has-new-devices {
    animation: vsd-discovery-found 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

.vsd-discovery-heading,
.cluster-vsd-tile__head,
.cluster-vsd-reading,
.soft-tou-mode-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.vsd-discovery-heading > div,
.soft-tou-mode-row > div {
    display: grid;
    gap: 0.15rem;
}

.vsd-discovery-heading span,
.soft-tou-mode-row span,
.cluster-vsd-reading span,
.vsd-empty-hint {
    color: rgba(203, 213, 225, 0.66);
    font-size: 0.75rem;
}

.vsd-discovery-count {
    flex: 0 0 auto;
    padding: 0.28rem 0.55rem;
    border: 1px solid rgba(45, 212, 191, 0.28);
    border-radius: 999px;
    background: rgba(20, 184, 166, 0.1);
    color: #99f6e4 !important;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.vsd-scan-progress-layout {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.9rem;
}

.vsd-scan-progress-icon {
    position: relative;
    display: grid;
    width: 2.8rem;
    height: 2.8rem;
    place-items: center;
    border: 1px solid rgba(45, 212, 191, 0.3);
    border-radius: 50%;
    background: rgba(13, 148, 136, 0.12);
    color: #5eead4;
}

.vsd-scan-progress-icon i {
    position: relative;
    z-index: 1;
    animation: vsd-radar-turn 1.8s linear infinite;
}

.vsd-scan-progress-icon span {
    position: absolute;
    inset: 0.32rem;
    border: 1px solid rgba(94, 234, 212, 0.7);
    border-radius: 50%;
    animation: vsd-radar-pulse 1.8s ease-out infinite;
}

.vsd-scan-progress-copy {
    display: grid;
    min-width: 0;
    gap: 0.55rem;
}

.vsd-scan-progress-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.vsd-scan-progress-heading > div {
    display: grid;
    min-width: 0;
    gap: 0.12rem;
}

.vsd-scan-progress-heading span {
    color: rgba(203, 213, 225, 0.66);
    font-size: 0.73rem;
}

.vsd-scan-progress-percent {
    color: #99f6e4;
    font-variant-numeric: tabular-nums;
}

.vsd-scan-progress-track {
    position: relative;
    height: 0.52rem;
    overflow: hidden;
    border: 1px solid rgba(45, 212, 191, 0.18);
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.64);
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.35);
}

.vsd-scan-progress-track > span {
    position: absolute;
    inset: 0 auto 0 0;
    min-width: 0.25rem;
    overflow: hidden;
    border-radius: inherit;
    background: linear-gradient(90deg, #0d9488, #2dd4bf 68%, #99f6e4);
    box-shadow: 0 0 14px rgba(45, 212, 191, 0.48);
    transition: width 120ms linear;
}

.vsd-scan-progress-track > span::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 45%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: vsd-scan-sheen 1.25s ease-in-out infinite;
}

.vsd-scan-cancel-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.35rem;
    padding: 0.5rem 0.72rem;
    border: 1px solid rgba(248, 113, 113, 0.3);
    border-radius: 0.62rem;
    background: rgba(127, 29, 29, 0.12);
    color: #fecaca;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.vsd-scan-cancel-button:hover:not(:disabled) {
    border-color: rgba(248, 113, 113, 0.62);
    background: rgba(127, 29, 29, 0.24);
    transform: translateY(-1px);
}

.vsd-scan-button {
    --scan-progress: 0%;
    position: relative;
    overflow: hidden;
    min-width: 148px;
    padding: 0.55rem 0.9rem;
    border: 1px solid rgba(34, 197, 94, 0.45);
    border-radius: 0.65rem;
    background: rgba(15, 23, 42, 0.88);
    color: #e2e8f0;
}

.vsd-scan-button::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--scan-progress);
    background: rgba(34, 197, 94, 0.42);
    transition: width 100ms linear;
}

.vsd-scan-button span { position: relative; z-index: 1; }
.vsd-pill-row, .cluster-vsd-pills, .soft-tou-vsd-pills, .cluster-summary-vsds {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.65rem;
}

.vsd-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    min-height: 30px;
    padding: 0.3rem 0.55rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 999px;
    color: #f8fafc;
    font-size: 0.75rem;
    line-height: 1;
    cursor: grab;
}

.vsd-pill--manual { background: #475569; }
.vsd-pill--green { background: #15803d; }
.vsd-pill--orange { background: #c2410c; }
.vsd-pill--red { background: #b91c1c; }
.vsd-pill--blue { background: #1d4ed8; }
.vsd-reachability-dot {
    width: 0.48rem;
    height: 0.48rem;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 50%;
    background: #94a3b8;
}
.vsd-pill.is-reachable .vsd-reachability-dot { background: #86efac; box-shadow: 0 0 0 3px rgba(134,239,172,.14); }
.vsd-pill.is-offline { opacity: 0.65; }

.vsd-pill.is-newly-discovered {
    animation: vsd-pill-discovered 820ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes vsd-radar-turn {
    to { transform: rotate(360deg); }
}

@keyframes vsd-radar-pulse {
    0% { opacity: 0.9; transform: scale(0.45); }
    80%, 100% { opacity: 0; transform: scale(1.42); }
}

@keyframes vsd-scan-sheen {
    from { transform: translateX(-130%); }
    to { transform: translateX(330%); }
}

@keyframes vsd-discovery-found {
    0% { border-color: rgba(45, 212, 191, 0.25); box-shadow: 0 0 0 rgba(45, 212, 191, 0); }
    42% { border-color: rgba(74, 222, 128, 0.8); box-shadow: 0 0 28px rgba(34, 197, 94, 0.2); }
    100% { border-color: rgba(148, 163, 184, 0.18); box-shadow: 0 0 0 rgba(45, 212, 191, 0); }
}

@keyframes vsd-pill-discovered {
    0% { opacity: 0; transform: translateY(-0.65rem) scale(0.72); box-shadow: 0 0 0 rgba(45, 212, 191, 0); }
    55% { opacity: 1; transform: translateY(0.08rem) scale(1.08); box-shadow: 0 0 22px rgba(45, 212, 191, 0.42); }
    100% { opacity: 1; transform: translateY(0) scale(1); box-shadow: 0 0 0 rgba(45, 212, 191, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .vsd-discovery-stage,
    .vsd-scan-progress-track > span,
    .vsd-scan-cancel-button {
        transition-duration: 1ms;
    }

    .vsd-discovery-strip.has-new-devices,
    .vsd-pill.is-newly-discovered,
    .vsd-scan-progress-icon i,
    .vsd-scan-progress-icon span,
    .vsd-scan-progress-track > span::after {
        animation: none;
    }
}

@media (max-width: 640px) {
    .vsd-scan-progress-layout {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 0.7rem;
    }

    .vsd-scan-cancel-button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .vsd-scan-progress-heading {
        align-items: center;
    }
}
.vsd-pill-remove { margin-left: 0.12rem; font-size: 1rem; cursor: pointer; }

.vsd-drag-template-store {
    display: none !important;
}

.cluster-vsd-section { margin: 0.7rem 0; padding: 0.8rem; }
.cluster-vsd-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr));
    gap: 0.75rem;
    margin-top: 0.7rem;
}

.cluster-vsd-drop-preview-host {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr));
    box-sizing: border-box;
    height: 0;
    margin: 0;
    overflow: hidden;
    opacity: 0;
    will-change: height, opacity, margin;
    transition:
        height 440ms cubic-bezier(.16, 1, .3, 1),
        margin 420ms cubic-bezier(.16, 1, .3, 1),
        opacity 180ms ease;
}

.cluster-vsd-drop-preview-host.has-vsd-preview {
    margin: 0.7rem 0;
    opacity: 1;
}

.vsd-drop-preview {
    min-width: 0;
    padding: 0.2rem 0.8rem 0.8rem;
    opacity: 0;
    pointer-events: none;
    transform-origin: top center;
}

.vsd-drop-preview.is-visible {
    opacity: 1;
}

.vsd-drop-preview.is-leaving {
    animation: vsd-preview-shell-leave 360ms cubic-bezier(.4, 0, .2, 1) forwards;
}

.vsd-drop-preview__clip {
    min-height: 0;
}

.vsd-drop-preview__label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 32px;
    margin-bottom: 0.42rem;
    border: 1px solid rgba(34, 211, 238, .46);
    border-radius: 0.65rem;
    color: #a5f3fc;
    background: linear-gradient(90deg, rgba(8, 145, 178, .16), rgba(20, 184, 166, .11));
    box-shadow: 0 0 22px rgba(34, 211, 238, .08);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: .025em;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(-12px);
}

.vsd-drop-preview__card {
    border-color: rgba(34, 211, 238, .52);
    box-shadow: 0 16px 36px rgba(2, 6, 23, .3), 0 0 0 1px rgba(34, 211, 238, .08);
    opacity: 0;
    transform: translate3d(0, -30px, 0) scale(.91);
    transform-origin: top center;
    filter: blur(3px);
    will-change: transform, opacity, filter;
}

.vsd-drop-preview.is-visible .vsd-drop-preview__label {
    animation: vsd-preview-label-enter 360ms 45ms cubic-bezier(.16, 1, .3, 1) both;
}

.vsd-drop-preview.is-visible .vsd-drop-preview__card {
    animation: vsd-preview-card-enter 560ms 35ms cubic-bezier(.16, 1, .3, 1) both;
}

.vsd-drop-preview.is-committing .vsd-drop-preview__label {
    color: #d1fae5;
    border-color: rgba(52, 211, 153, .58);
    background: linear-gradient(90deg, rgba(5, 150, 105, .22), rgba(8, 145, 178, .14));
}

.vsd-drop-preview.is-committing .vsd-drop-preview__label i {
    animation: vsd-preview-commit-pulse 700ms ease-in-out infinite alternate;
}

@keyframes vsd-preview-commit-pulse {
    from { transform: translateY(-1px); opacity: .62; }
    to { transform: translateY(2px); opacity: 1; }
}

@keyframes vsd-preview-label-enter {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes vsd-preview-card-enter {
    0% { opacity: 0; transform: translate3d(0, -30px, 0) scale(.91); filter: blur(3px); }
    72% { opacity: 1; transform: translate3d(0, 3px, 0) scale(1.012); filter: blur(0); }
    100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); filter: blur(0); }
}

@keyframes vsd-preview-shell-leave {
    from { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
    to { opacity: 0; transform: translate3d(0, -18px, 0) scale(.965); }
}

.cluster-vsd-tile {
    position: relative;
    min-width: 0;
    padding: 0.8rem;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.9rem;
    background:
        radial-gradient(circle at 100% 0%, rgba(56, 189, 248, 0.09), transparent 42%),
        rgba(2, 8, 23, 0.72);
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.18);
    transition: border-color 180ms ease, box-shadow 180ms ease;
}
.cluster-vsd-tile.is-running {
    border-color: rgba(34, 197, 94, 0.42);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.08), 0 12px 30px rgba(2, 6, 23, 0.2);
}

.cluster-vsd-tile.is-removing {
    border-color: rgba(34, 211, 238, .5);
    box-shadow: 0 0 0 1px rgba(34, 211, 238, .12), 0 18px 42px rgba(2, 6, 23, .3);
}

.vsd-removal-sync {
    position: absolute;
    z-index: 12;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .42rem;
    padding: 1.2rem;
    border-radius: inherit;
    background: linear-gradient(145deg, rgba(2, 12, 27, .89), rgba(5, 32, 39, .94));
    backdrop-filter: blur(7px);
    animation: vsd-removal-overlay-enter 240ms ease both;
}

.vsd-removal-sync::before {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(34, 211, 238, .42);
    border-radius: inherit;
    box-shadow: inset 0 0 28px rgba(34, 211, 238, .08);
    content: "";
    pointer-events: none;
}

.vsd-removal-sync__spinner {
    width: 2rem;
    height: 2rem;
    margin-bottom: .18rem;
    border: 3px solid rgba(148, 163, 184, .22);
    border-top-color: #22d3ee;
    border-right-color: #2dd4bf;
    border-radius: 50%;
    box-shadow: 0 0 18px rgba(34, 211, 238, .24);
    animation: vsd-removal-spinner 760ms linear infinite;
}

.vsd-removal-sync strong {
    color: #ecfeff;
    font-size: .84rem;
    letter-spacing: .01em;
}

.vsd-removal-sync > span:last-child {
    max-width: 17rem;
    color: #94a3b8;
    font-size: .68rem;
    line-height: 1.35;
    text-align: center;
}

.cluster-vsd-tile.is-removal-confirmed .vsd-removal-sync__spinner {
    border-color: rgba(52, 211, 153, .22);
    border-top-color: #34d399;
    border-right-color: #22d3ee;
}

.vsd-pill.is-removing {
    pointer-events: none;
    opacity: .62;
}

.vsd-pill.is-returning {
    opacity: 0;
}

@keyframes vsd-removal-overlay-enter {
    from { opacity: 0; transform: scale(.985); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes vsd-removal-spinner {
    to { transform: rotate(360deg); }
}
.cluster-vsd-tile.is-faulted { border-color: rgba(248, 113, 113, 0.55); }
.cluster-vsd-section > .cluster-vsd-tiles { margin-top: 0; }
.cluster-vsd-tile__head {
    align-items: flex-start;
    min-height: 58px;
    margin: -0.8rem -0.8rem 0;
    padding: 0.72rem 0.8rem;
    border-bottom: 1px solid rgba(148, 163, 184, .16);
    border-radius: .9rem .9rem 0 0;
    cursor: grab;
    transition: background 260ms ease, border-color 260ms ease, box-shadow 260ms ease;
}
.cluster-vsd-tile__head:active { cursor: grabbing; }
.cluster-vsd-tile__head.is-dragging {
    opacity: .55;
    transform: scale(.985);
}
.cluster-vsd-title-block { display: grid; gap: 0.08rem; min-width: 0; }
.cluster-vsd-tile__head strong { overflow: hidden; color: #f8fafc; text-overflow: ellipsis; white-space: nowrap; }
.cluster-vsd-head-controls {
    display: flex !important;
    flex: 0 0 auto;
    align-items: flex-start;
    gap: .5rem !important;
}
.cluster-vsd-state-stack {
    display: grid !important;
    gap: .24rem !important;
    min-width: 0;
    justify-items: end;
}
.cluster-vsd-tou-warning {
    color: #f87171;
    font-size: .62rem;
    font-weight: 750;
    line-height: 1.1;
    white-space: nowrap;
}
.cluster-vsd-remove-button {
    display: grid;
    flex: 0 0 auto;
    width: 1.72rem;
    height: 1.72rem;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(248, 113, 113, .3);
    border-radius: .48rem;
    color: #fca5a5;
    background: rgba(127, 29, 29, .2);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.cluster-vsd-remove-button:hover:not(:disabled) {
    border-color: rgba(248, 113, 113, .62);
    background: rgba(153, 27, 27, .38);
    transform: translateY(-1px);
}
.cluster-vsd-remove-button:disabled { cursor: wait; opacity: .5; }
.cluster-vsd-tile__head.vsd-tou-header--unassigned {
    background: linear-gradient(105deg, rgba(15, 23, 42, .92), rgba(15, 23, 42, .54));
}
.cluster-vsd-tile__head.vsd-tou-header--green {
    border-bottom-color: rgba(74, 222, 128, .34);
    background: linear-gradient(105deg, rgba(20, 83, 45, .76), rgba(21, 128, 61, .32));
    box-shadow: inset 3px 0 0 rgba(74, 222, 128, .78);
}
.cluster-vsd-tile__head.vsd-tou-header--orange {
    border-bottom-color: rgba(251, 146, 60, .38);
    background: linear-gradient(105deg, rgba(124, 45, 18, .78), rgba(194, 65, 12, .32));
    box-shadow: inset 3px 0 0 rgba(251, 146, 60, .82);
}
.cluster-vsd-tile__head.vsd-tou-header--red {
    border-bottom-color: rgba(248, 113, 113, .38);
    background: linear-gradient(105deg, rgba(127, 29, 29, .78), rgba(185, 28, 28, .32));
    box-shadow: inset 3px 0 0 rgba(248, 113, 113, .8);
}
.cluster-vsd-tile__head.vsd-tou-header--blue {
    border-bottom-color: rgba(96, 165, 250, .4);
    background: linear-gradient(105deg, rgba(30, 58, 138, .78), rgba(29, 78, 216, .32));
    box-shadow: inset 3px 0 0 rgba(96, 165, 250, .84);
}
.cluster-vsd-id { color: #64748b; font-size: 0.65rem; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; }
.cluster-vsd-state {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.08rem;
    padding: 0.26rem 0.48rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 999px;
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.8);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}
.cluster-vsd-state i {
    margin-right: 0.22rem;
    color: #94a3b8;
    font-size: 0.43rem;
}
.cluster-vsd-operating-state,
.cluster-vsd-state-separator {
    color: #cbd5e1;
}
.cluster-vsd-connectivity.is-online { color: #2dd4bf; }
.cluster-vsd-connectivity.is-offline { color: #f87171; }
.cluster-vsd-state.is-running { color: #86efac; border-color: rgba(34, 197, 94, 0.32); background: rgba(20, 83, 45, 0.28); }
.cluster-vsd-state.is-stopped { color: #cbd5e1; }
.cluster-vsd-state.is-faulted { color: #fca5a5; border-color: rgba(248, 113, 113, 0.38); background: rgba(127, 29, 29, 0.28); }
.cluster-vsd-state.is-offline { color: #94a3b8; opacity: 0.8; }
.cluster-vsd-overview { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 0.8rem; margin: 0.8rem 0 0.68rem; }
.cluster-vsd-gauge {
    display: grid;
    width: 92px;
    aspect-ratio: 1;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(#22c55e var(--vsd-load), rgba(71, 85, 105, 0.28) 0);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 0 22px rgba(34, 197, 94, 0.08);
}
.cluster-vsd-gauge__center {
    display: grid;
    width: 72px;
    aspect-ratio: 1;
    place-content: center;
    border-radius: 50%;
    background: #07111f;
    text-align: center;
}
.cluster-vsd-gauge__center strong { color: #f8fafc; font-size: 1.25rem; line-height: 1; }
.cluster-vsd-gauge__center span { margin-top: 0.18rem; color: #64748b; font-size: 0.65rem; font-weight: 700; }
.cluster-vsd-telemetry { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.42rem 0.6rem; }
.cluster-vsd-telemetry span { display: grid; min-width: 0; gap: 0.04rem; }
.cluster-vsd-telemetry small { color: #64748b; font-size: 0.62rem; line-height: 1.1; }
.cluster-vsd-telemetry strong { overflow: hidden; color: #dbeafe; font-size: 0.73rem; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.cluster-vsd-mode-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0.45rem 0;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    color: #64748b;
    font-size: 0.66rem;
}
.cluster-vsd-mode-line strong { color: #cbd5e1; font-size: 0.68rem; }
.cluster-vsd-policy-note {
    display: block;
    min-height: 1.7em;
    color: #7dd3fc;
    font-size: 0.61rem;
    line-height: 1.35;
}

.cluster-vsd-policy-note--warning {
    color: #ff9d9d;
}
.cluster-vsd-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .42rem; margin-top: .42rem; }
@property --vsd-border-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}
.vsd-mode-button {
    --vsd-button-fill: rgba(15, 23, 42, 0.78);
    --vsd-button-base: #0f172a;
    --vsd-active-accent: #38bdf8;
    --vsd-border-angle: 0deg;
    position: relative;
    min-width: 0;
    padding: calc(0.5rem - 1px) 0.28rem;
    border: 2px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.55rem;
    color: #94a3b8;
    background: var(--vsd-button-fill);
    font-size: 0.65rem;
    font-weight: 850;
    letter-spacing: 0.03em;
    cursor: pointer;
}
.vsd-mode-button i { margin-right: 0.24rem; }
.vsd-mode-button.is-stop.is-active {
    --vsd-button-fill: rgba(127, 29, 29, 0.44);
    --vsd-active-accent: #fb7185;
    color: #fecaca;
}
.vsd-mode-button.is-start.is-active {
    --vsd-button-fill: rgba(20, 83, 45, 0.44);
    --vsd-active-accent: #4ade80;
    color: #bbf7d0;
}
.vsd-mode-button.is-tou.is-tou-effective {
    --vsd-button-fill: rgba(20, 83, 45, 0.52);
    --vsd-active-accent: #22d3ee;
    border-color: rgba(74, 222, 128, 0.48);
    color: #dcfce7;
}
.vsd-mode-button.is-tou.is-tou-inactive {
    --vsd-button-fill: rgba(113, 63, 18, 0.5);
    --vsd-active-accent: #22d3ee;
    border-color: rgba(251, 191, 36, 0.48);
    color: #fef3c7;
}
.vsd-mode-button.is-active {
    border-color: transparent;
    background:
        linear-gradient(var(--vsd-button-fill), var(--vsd-button-fill)) padding-box,
        linear-gradient(var(--vsd-button-base), var(--vsd-button-base)) padding-box,
        conic-gradient(
            from var(--vsd-border-angle),
            rgba(148, 163, 184, 0.24) 0deg,
            rgba(148, 163, 184, 0.24) 18deg,
            var(--vsd-active-accent) 36deg,
            rgba(255, 255, 255, 0.95) 43deg,
            var(--vsd-active-accent) 50deg,
            rgba(148, 163, 184, 0.24) 72deg,
            rgba(148, 163, 184, 0.24) 360deg
        ) border-box;
    animation: vsd-active-border-trace 2.4s linear infinite;
}
.vsd-mode-button:disabled { cursor: not-allowed; opacity: 0.42; }
@keyframes vsd-active-border-trace {
    to { --vsd-border-angle: 360deg; }
}

.tou-control-mode-banner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.72rem;
    padding: 0.78rem;
    margin-bottom: 0.7rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.75rem;
    background: rgba(15, 23, 42, 0.58);
}
.tou-control-mode-banner.is-hard { border-color: rgba(245, 158, 11, 0.34); background: rgba(120, 53, 15, 0.16); }
.tou-control-mode-banner.is-soft { border-color: rgba(34, 197, 94, 0.34); background: rgba(20, 83, 45, 0.16); }
.tou-control-mode-banner.is-unavailable { border-color: rgba(148, 163, 184, 0.22); }
.tou-control-mode-icon { display: grid; width: 2.25rem; aspect-ratio: 1; place-items: center; border-radius: 0.65rem; color: #cbd5e1; background: rgba(148, 163, 184, 0.1); }
.tou-control-mode-banner > div { display: grid; gap: 0.13rem; }
.tou-control-mode-banner strong { color: #f8fafc; }
.tou-control-mode-banner span { color: #94a3b8; font-size: 0.75rem; }
.soft-tou-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin: .65rem 0; }
.soft-tou-tab { min-height: 44px; padding: .55rem; border: 2px solid transparent; border-radius: .55rem; color: white; opacity: .65; cursor: pointer; transition: transform 150ms ease, opacity 150ms ease, border-color 150ms ease; }
.soft-tou-tab:hover { opacity: .9; transform: translateY(-1px); }
.soft-tou-tab.is-active { border-color: white; opacity: 1; box-shadow: 0 0 0 2px rgba(255,255,255,.12); }

.live-monitor-container .vsd-pill {
    touch-action: none;
    user-select: none;
    transition: opacity 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.live-monitor-container .vsd-pill.is-dragging {
    cursor: grabbing;
    opacity: .5;
    transform: scale(.96);
}

.live-monitor-container [data-vsd-drop-kind] {
    transition:
        outline-color 180ms ease,
        box-shadow 360ms cubic-bezier(.16, 1, .3, 1),
        background-color 360ms cubic-bezier(.16, 1, .3, 1),
        border-color 360ms cubic-bezier(.16, 1, .3, 1);
}

.live-monitor-container [data-vsd-drop-kind="cluster"].is-vsd-preview-expanded {
    border-color: rgba(34, 211, 238, .4);
    background-color: rgba(6, 32, 43, .34);
    box-shadow: 0 20px 52px rgba(2, 8, 23, .28), 0 0 0 1px rgba(34, 211, 238, .1);
}

html.vsd-drag-active .live-monitor-container [data-vsd-drop-kind] {
    outline: 1px dashed rgba(34, 211, 238, .62);
    outline-offset: 4px;
}

html.vsd-drag-active .live-monitor-container [data-vsd-drop-kind].is-vsd-drag-over {
    outline: 2px solid #22d3ee;
    outline-offset: 4px;
    box-shadow: 0 0 0 5px rgba(34, 211, 238, .16), 0 0 24px rgba(34, 211, 238, .18);
}

@media (prefers-reduced-motion: reduce) {
    .cluster-vsd-drop-preview-host,
    .vsd-drop-preview,
    .vsd-drop-preview__label,
    .vsd-drop-preview__card,
    .vsd-removal-sync,
    .vsd-removal-sync__spinner {
        animation-duration: 1ms !important;
        transition-duration: 1ms !important;
    }
}

html.vsd-drag-active .live-monitor-container [data-vsd-drop-kind="cluster"] {
    position: relative;
}

html.vsd-drag-active .live-monitor-container [data-vsd-drop-kind="cluster"]::after {
    position: absolute;
    z-index: 8;
    top: .75rem;
    left: 50%;
    padding: .4rem .75rem;
    border: 1px solid rgba(34, 211, 238, .7);
    border-radius: 999px;
    background: rgba(9, 30, 34, .94);
    color: #a5f3fc;
    content: "Drop VSD into this cluster";
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
    pointer-events: none;
    transform: translateX(-50%);
}
.soft-tou-final-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.soft-tou-final-copy { color: rgba(226,232,240,.78); }
.vsd-cluster-picker { display: grid; gap: .5rem; }
.vsd-cluster-option { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .7rem; padding: .8rem; border: 1px solid rgba(148,163,184,.2); border-radius: .65rem; background: rgba(15,23,42,.7); color: #e2e8f0; text-align: left; }

@media (max-width: 640px) {
    .vsd-discovery-heading { align-items: stretch; flex-direction: column; }
    .vsd-scan-button { width: 100%; }
    .soft-tou-tabs { grid-template-columns: repeat(2, 1fr); }
    .soft-tou-final-actions .e-btn { width: 100%; }
    .cluster-vsd-overview { grid-template-columns: 80px minmax(0, 1fr); }
    .cluster-vsd-gauge { width: 80px; }
    .cluster-vsd-gauge__center { width: 62px; }
}

@media (prefers-reduced-motion: reduce) {
    .vsd-mode-button.is-active {
        --vsd-border-angle: 36deg;
        animation: none;
    }
}

/* Sentinel AUX 485 / VEICHI SI23 live status. */
.live-monitor-container .vsd-monitor-card {
    margin-bottom: 0.7rem;
    border: 1px solid rgba(70, 180, 255, 0.28);
    background:
        radial-gradient(circle at 12% 0%, rgba(30, 144, 255, 0.13), transparent 38%),
        rgba(10, 20, 34, 0.94);
}

.vsd-monitor-layout {
    display: grid;
    gap: 0.9rem;
}

.vsd-monitor-heading,
.vsd-monitor-title,
.vsd-control-panel {
    display: flex;
    align-items: center;
}

.vsd-monitor-heading {
    justify-content: space-between;
    gap: 1rem;
}

.vsd-monitor-title {
    min-width: 0;
    gap: 0.8rem;
}

.vsd-monitor-title > i {
    color: #49b7ff;
    font-size: 1.7rem;
}

.vsd-monitor-title h2 {
    margin: 0;
    color: #f5f9ff;
    font-size: 1.08rem;
    font-weight: 700;
}

.vsd-monitor-title span {
    display: block;
    margin-top: 0.18rem;
    color: rgba(224, 235, 247, 0.62);
    font-size: 0.78rem;
}

.vsd-state-pill {
    flex: 0 0 auto;
    padding: 0.32rem 0.68rem;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.16);
    color: #cbd5e1;
    font-size: 0.78rem;
    font-weight: 700;
}

.vsd-state-pill.running {
    border-color: rgba(34, 197, 94, 0.45);
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
}

.vsd-state-pill.stopping {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.14);
    color: #fcd34d;
}

.vsd-state-pill.fault {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.16);
    color: #fca5a5;
}

.vsd-monitor-body {
    display: grid;
    grid-template-columns: minmax(190px, 0.75fr) minmax(360px, 2fr) minmax(170px, auto);
    align-items: center;
    gap: 1rem;
}

.vsd-power-gauge {
    position: relative;
    width: min(220px, 100%);
    min-height: 125px;
    margin-inline: auto;
}

.vsd-power-gauge svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.vsd-gauge-track,
.vsd-gauge-value {
    fill: none;
    stroke-width: 17;
    stroke-linecap: round;
}

.vsd-gauge-track {
    stroke: rgba(148, 163, 184, 0.18);
}

.vsd-gauge-value {
    stroke: #32c5ff;
    filter: drop-shadow(0 0 5px rgba(50, 197, 255, 0.5));
    transition: stroke-dasharray 300ms ease;
}

.vsd-gauge-reading {
    position: absolute;
    inset: 66px 0 auto;
    display: grid;
    justify-items: center;
    gap: 0.12rem;
}

.vsd-gauge-reading strong {
    color: #f8fafc;
    font-size: 1.22rem;
}

.vsd-gauge-reading span {
    color: rgba(226, 232, 240, 0.62);
    font-size: 0.72rem;
}

.vsd-telemetry-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(105px, 1fr));
    gap: 0.55rem;
}

.vsd-telemetry-item {
    min-width: 0;
    padding: 0.55rem 0.65rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 0.55rem;
    background: rgba(15, 23, 42, 0.48);
}

.vsd-telemetry-item span,
.vsd-telemetry-item strong {
    display: block;
}

.vsd-telemetry-item span {
    color: rgba(203, 213, 225, 0.62);
    font-size: 0.7rem;
}

.vsd-telemetry-item strong {
    margin-top: 0.15rem;
    overflow: hidden;
    color: #eaf4ff;
    font-size: 0.84rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vsd-frequency-reading {
    display: inline-flex !important;
    min-width: 0;
    align-items: center;
    gap: 0.28rem;
    white-space: nowrap;
}

.vsd-frequency-target {
    display: inline-flex;
    min-width: 0;
    align-items: baseline;
    gap: 0.12rem;
    color: #eaf4ff;
    font-weight: 700;
    line-height: 1;
}

.vsd-frequency-target > strong,
.vsd-frequency-current {
    min-width: 0;
    margin: 0;
}

.vsd-frequency-edit-button {
    display: inline-grid;
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #6ee7d8;
    font-size: 0.58rem;
    line-height: 1;
    vertical-align: baseline;
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.vsd-frequency-edit-button:hover:not(:disabled),
.vsd-frequency-edit-button:focus-visible {
    outline: none;
    background: rgba(20, 184, 166, 0.22);
    color: #ccfbf1;
    transform: translateY(-1px);
}

.vsd-frequency-edit-button:disabled {
    background: transparent;
    color: rgba(148, 163, 184, 0.42);
    cursor: not-allowed;
}

.cluster-vsd-frequency-item {
    grid-column: 1 / -1;
}

.cluster-vsd-frequency-item .vsd-frequency-reading {
    display: inline-flex !important;
    align-items: center;
    gap: 0.22rem;
}

.cluster-vsd-frequency-item .vsd-frequency-target {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: baseline;
    gap: 0.08rem;
}

.cluster-vsd-frequency-item .vsd-frequency-target > span {
    display: inline;
}

.cluster-vsd-frequency-item .vsd-frequency-edit-button {
    width: 0.95rem;
    height: 0.95rem;
    font-size: 0.58rem;
}

.vsd-voltage-reading {
    display: inline-flex !important;
    min-width: 0;
    align-items: center;
    gap: 0.28rem;
    white-space: nowrap;
}

.vsd-voltage-scale {
    display: inline-flex;
    min-width: 0;
    align-items: baseline;
    gap: 0.12rem;
    color: #eaf4ff;
    font-weight: 700;
    line-height: 1;
}

.vsd-voltage-scale > strong,
.vsd-voltage-current {
    min-width: 0;
    margin: 0;
}

.cluster-vsd-voltage-item {
    grid-column: 1 / -1;
}

.cluster-vsd-voltage-item .vsd-voltage-reading {
    display: inline-flex !important;
    align-items: center;
    gap: 0.22rem;
}

.cluster-vsd-voltage-item .vsd-voltage-scale {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: baseline;
    gap: 0.08rem;
}

.cluster-vsd-voltage-item .vsd-voltage-scale > span {
    display: inline;
}

.cluster-vsd-voltage-item .vsd-voltage-edit-button {
    width: 0.95rem;
    height: 0.95rem;
    font-size: 0.58rem;
}

.vsd-control-panel {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.vsd-last-update {
    flex-basis: 100%;
    color: rgba(203, 213, 225, 0.58);
    font-size: 0.7rem;
    text-align: right;
}

.vsd-error-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.55rem;
    background: rgba(127, 29, 29, 0.2);
    color: #fecaca;
    font-size: 0.78rem;
}

@media (max-width: 980px) {
    .vsd-monitor-body {
        grid-template-columns: minmax(170px, 0.8fr) minmax(300px, 2fr);
    }

    .vsd-control-panel {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .vsd-last-update {
        flex-basis: auto;
        margin-left: auto;
    }
}

@media (max-width: 640px) {
    .live-monitor-container .vsd-monitor-card {
        margin-bottom: 0.5rem;
    }

    .vsd-monitor-heading {
        align-items: flex-start;
    }

    .vsd-monitor-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .vsd-telemetry-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .vsd-control-panel {
        grid-column: auto;
        justify-content: stretch;
    }

    .vsd-control-panel .e-btn {
        flex: 1 1 0;
    }

    .vsd-last-update {
        flex-basis: 100%;
        margin-left: 0;
        text-align: left;
    }
}

/* Low-voltage LBSA battery monitoring */
.lv-battery-data-dialog__content {
    display: grid;
    gap: 0.9rem;
    color: rgba(255, 255, 255, 0.82);
}

.lv-battery-data-dialog__content p {
    margin: 0;
    line-height: 1.55;
}

.lv-battery-data-dialog__content label {
    margin-bottom: -0.45rem;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.lv-battery-data-dialog__content .form-select {
    border-color: rgba(64, 205, 183, 0.3);
    background-color: #121a20;
    color: #f4fbfa;
}

.lv-battery-transfer-note,
.lv-battery-delete-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.8rem;
    border: 1px solid rgba(74, 196, 255, 0.2);
    border-radius: 10px;
    background: rgba(43, 137, 181, 0.1);
    font-size: 0.82rem;
    line-height: 1.45;
}

.lv-battery-delete-warning {
    border-color: rgba(255, 82, 82, 0.25);
    background: rgba(255, 82, 82, 0.09);
}

.lv-battery-transfer-note i {
    color: #5edcf1;
}

.lv-battery-delete-warning i {
    color: #ff6b6b;
}

.lv-battery-monitor {
    margin: 1rem 0;
    padding: 1rem;
    display: grid;
    gap: 1rem;
    border: 1px solid rgba(43, 201, 157, 0.22);
    border-radius: 22px;
    background: linear-gradient(140deg, rgba(14, 39, 48, 0.84), rgba(9, 24, 34, 0.84));
}

.lv-battery-monitor__title,
.lv-battery-monitor__title > div,
.lv-battery-cluster > header,
.lv-battery-cluster > header > div {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.lv-battery-monitor__title {
    justify-content: space-between;
}

.lv-battery-monitor__title i {
    color: #21c997;
    font-size: 1.3rem;
}

.lv-battery-monitor__title h2 {
    margin: 0;
    color: #effaf7;
    font-size: 1.05rem;
}

.lv-battery-monitor__title div div,
.lv-battery-cluster > header > div {
    display: flex;
    flex-wrap: wrap;
}

.lv-battery-monitor__title span,
.lv-battery-cluster > header span {
    color: rgba(225, 241, 241, 0.62);
    font-size: 0.76rem;
}

.lv-battery-cluster {
    display: grid;
    gap: 0.7rem;
}

.lv-battery-cluster > header {
    justify-content: space-between;
    padding: 0 0.2rem 0.55rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #e9f7f4;
}

.lv-battery-cluster > header i {
    color: #51d9b5;
}

.lv-battery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
    gap: 0.85rem;
}

.lv-battery-card {
    --lv-accent: #21c997;
    min-width: 0;
    padding: 1rem;
    display: grid;
    gap: 0.9rem;
    border: 1px solid color-mix(in srgb, var(--lv-accent) 42%, rgba(255, 255, 255, 0.13));
    border-radius: 18px;
    background: linear-gradient(150deg, rgba(20, 36, 48, 0.98), rgba(12, 24, 34, 0.98));
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22);
    color: #edf7f5;
}

.lv-battery-card.is-offline {
    --lv-accent: #718096;
    opacity: 0.78;
}

.lv-battery-card.has-protection {
    --lv-accent: #f05f68;
}

.lv-battery-card.has-warning {
    --lv-accent: #f4b740;
}

.lv-battery-card.is-charge-wait {
    --lv-accent: #42b8e8;
}

.lv-battery-card__header,
.lv-battery-card__headline,
.lv-battery-card__derating,
.lv-battery-card footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.lv-battery-card__header > div {
    min-width: 0;
    display: grid;
}

.lv-battery-card__address,
.lv-battery-card small {
    color: rgba(226, 240, 244, 0.66);
    font-size: 0.74rem;
}

.lv-battery-card__header strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lv-battery-card__state {
    padding: 0.34rem 0.58rem;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid color-mix(in srgb, var(--lv-accent) 42%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--lv-accent) 15%, transparent);
    color: var(--lv-accent);
    font-size: 0.72rem;
    font-weight: 700;
}

.lv-battery-card__soc {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
}

.lv-battery-card__soc strong {
    color: var(--lv-accent);
    font-size: 2rem;
    line-height: 1;
}

.lv-battery-card__soc span {
    color: rgba(226, 240, 244, 0.62);
    font-size: 0.7rem;
    font-weight: 700;
}

.lv-battery-card__electrical,
.lv-battery-card__extrema,
.lv-battery-card__details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.lv-battery-card__electrical {
    flex: 1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lv-battery-card__electrical span,
.lv-battery-card__extrema span,
.lv-battery-card__details span {
    display: grid;
}

.lv-battery-card__electrical small,
.lv-battery-card__extrema small,
.lv-battery-card__details small {
    font-size: 0.66rem;
}

.lv-battery-card__electrical strong,
.lv-battery-card__extrema strong,
.lv-battery-card__details strong {
    font-size: 0.82rem;
}

.lv-battery-card__extrema,
.lv-battery-card__details {
    padding: 0.7rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
}

.lv-battery-card__limits {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.lv-battery-card__limits > div {
    padding: 0.65rem;
    display: grid;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: color-mix(in srgb, var(--lv-accent) 8%, rgba(255, 255, 255, 0.025));
}

.lv-battery-card__limits span {
    color: rgba(226, 240, 244, 0.68);
    font-size: 0.7rem;
}

.lv-battery-card__limits strong {
    color: var(--lv-accent);
}

.lv-battery-card__derating-track {
    height: 7px;
    display: block;
    flex: 1;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
}

.lv-battery-card__derating-track span {
    height: 100%;
    display: block;
    background: var(--lv-accent);
}

.lv-battery-card__derating > span,
.lv-battery-card__derating > strong {
    font-size: 0.72rem;
}

.lv-battery-card__notice {
    padding: 0.6rem 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(66, 184, 232, 0.3);
    border-radius: 10px;
    background: rgba(66, 184, 232, 0.12);
    color: #9bddf6;
    font-size: 0.78rem;
}

.lv-battery-card__markers {
    padding-top: 0.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.lv-battery-card__markers summary {
    color: rgba(226, 240, 244, 0.72);
    cursor: pointer;
    font-size: 0.76rem;
}

.lv-battery-card__markers > div {
    margin-top: 0.6rem;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.35rem 0.6rem;
    font-size: 0.7rem;
}

.lv-battery-card__markers code {
    color: #aee7da;
    overflow-wrap: anywhere;
}

.lv-battery-card footer {
    color: rgba(226, 240, 244, 0.55);
    font-size: 0.68rem;
}

/* LV cards deliberately reuse the HV BatteryCard structure and density. */
.lv-battery-monitor {
    margin: 0.7rem 0;
    padding: 0;
    gap: 0.65rem;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.lv-battery-monitor__title {
    padding: 0 0.2rem;
}

.lv-battery-cluster {
    gap: 0.55rem;
}

.lv-battery-cluster > header {
    margin-bottom: 0;
    padding: 0 0.2rem 0.45rem;
}

.lv-battery-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(350px, 100%), 410px));
    justify-content: center;
    justify-items: center;
    align-items: start;
    gap: 0.7rem;
}

.battery-card.lv-battery-card {
    width: 100%;
    min-width: 350px;
    max-width: 410px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    border-radius: 4px;
    background: var(--bg-card, #2a2a2a);
    color: white;
    box-shadow: none;
}

.battery-card.lv-battery-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.battery-card.lv-battery-card.lv-has-protection {
    border-color: var(--color-danger, #f44336);
}

.battery-card.lv-battery-card.lv-has-protection > .e-card-header {
    background: rgba(var(--color-danger-rgb, 244, 67, 54), 0.12) !important;
}

.battery-card.lv-battery-card.lv-has-warning {
    border-color: #f6ad55;
}

.battery-card.lv-battery-card.lv-has-warning > .e-card-header {
    background: rgba(246, 173, 85, 0.12) !important;
}

.battery-card.lv-battery-card.lv-charge-wait {
    border-color: #42b8e8;
}

.battery-card.lv-battery-card.lv-charge-wait > .e-card-header {
    background: rgba(66, 184, 232, 0.12) !important;
}

.battery-card.lv-battery-card small {
    color: rgba(255, 255, 255, 0.6);
    font-size: inherit;
}

.battery-card.lv-battery-card .lv-battery-address {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.45rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}

.battery-card.lv-battery-card .lv-battery-markers {
    min-width: 0;
}

.battery-card.lv-battery-card .lv-battery-markers > summary {
    list-style: none;
}

.battery-card.lv-battery-card .lv-battery-markers > summary::-webkit-details-marker {
    display: none;
}

.battery-card.lv-battery-card .lv-battery-markers[open] > summary .fa-chevron-down {
    transform: rotate(180deg);
}

.battery-card.lv-battery-card .lv-battery-marker-grid {
    margin-top: 0.4rem;
    padding: 0.45rem 0.5rem;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.3rem 0.55rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.7rem;
}

.battery-card.lv-battery-card .lv-battery-marker-grid code {
    color: #aee7da;
    overflow-wrap: anywhere;
}

@media (max-width: 420px) {
    .battery-card.lv-battery-card {
        min-width: 0;
    }
}

.system-config-interface-fields,
.system-config-lv-policy__grid {
    width: min(100%, 480px);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.system-config-lv-policy {
    margin-bottom: 1rem;
    padding: 0.9rem;
    display: grid;
    gap: 0.8rem;
    border: 1px solid rgba(32, 189, 147, 0.22);
    border-radius: 14px;
    background: rgba(32, 189, 147, 0.07);
}

.system-config-lv-policy__heading {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.system-config-lv-policy__heading i {
    color: #21c997;
    font-size: 1.2rem;
}

.system-config-lv-policy__heading > div,
.system-config-lv-policy__grid label {
    display: grid;
}

.system-config-lv-policy__heading span,
.system-config-lv-policy__grid span,
.system-config-lv-policy__grid small,
.system-config-lv-policy__note {
    color: rgba(225, 241, 241, 0.66);
    font-size: 0.73rem;
}

.system-config-lv-policy__grid label {
    gap: 0.25rem;
}

@media (max-width: 640px) {
    .system-config-interface-fields,
    .system-config-lv-policy__grid {
        width: 100%;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .lv-battery-card__headline {
        align-items: stretch;
        flex-direction: column;
    }
}

.lv-cells-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 100%;
    color: #f4f7fb;
}

.lv-cells-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid rgba(94, 234, 212, 0.18);
}

.lv-cells-toolbar h3 {
    margin: 0;
    font-size: 1.15rem;
}

.lv-cells-toolbar h3 i {
    margin-right: 0.45rem;
    color: #4fd1c5;
}

.lv-cells-toolbar p {
    margin: 0.25rem 0 0;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.82rem;
}

.lv-cells-battery-select {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 260px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
}

.lv-cells-battery-select select {
    min-height: 38px;
    padding: 0.45rem 2rem 0.45rem 0.7rem;
    border: 1px solid rgba(79, 209, 197, 0.32);
    border-radius: 6px;
    background: #111820;
    color: #fff;
}

.lv-cells-loading {
    display: flex;
    flex: 1;
    min-height: 280px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    color: rgba(255, 255, 255, 0.65);
    text-align: center;
}

.lv-cells-loading i {
    color: #4fd1c5;
    font-size: 2rem;
}

.lv-cells-loading strong {
    color: #fff;
}

.lv-cells-empty i {
    color: #f6ad55;
}

.lv-cells-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.55rem;
}

.lv-cells-summary > span {
    padding: 0.55rem 0.7rem;
    border: 1px solid rgba(79, 209, 197, 0.16);
    border-radius: 6px;
    background: rgba(9, 16, 22, 0.72);
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.78rem;
}

.lv-cells-summary strong {
    color: #fff;
}

.lv-cells-summary .lv-cells-updated {
    text-align: right;
}

.lv-cell-voltage-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.6rem;
}

.lv-cell-card {
    min-height: 92px;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 7px;
    background: rgba(12, 18, 23, 0.86);
}

.lv-cell-card.highest {
    border-color: rgba(246, 173, 85, 0.58);
    box-shadow: inset 0 0 0 1px rgba(246, 173, 85, 0.12);
}

.lv-cell-card.lowest {
    border-color: rgba(99, 179, 237, 0.58);
    box-shadow: inset 0 0 0 1px rgba(99, 179, 237, 0.12);
}

.lv-cell-card.warning {
    border-color: rgba(252, 129, 129, 0.75);
    background: rgba(74, 24, 27, 0.42);
}

.lv-cell-card.balancing {
    background: rgba(35, 75, 61, 0.42);
}

.lv-cell-number {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.72rem;
    text-transform: uppercase;
}

.lv-cell-voltage {
    margin-top: 0.16rem;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
}

.lv-cell-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    min-height: 1rem;
    margin-top: 0.35rem;
}

.lv-cell-flag {
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 700;
}

.lv-cell-flag.high {
    background: rgba(246, 173, 85, 0.18);
    color: #f6ad55;
}

.lv-cell-flag.low {
    background: rgba(99, 179, 237, 0.18);
    color: #63b3ed;
}

.lv-cell-flag.balance {
    background: rgba(72, 187, 120, 0.18);
    color: #68d391;
}

.lv-cell-flag.warning {
    background: rgba(252, 129, 129, 0.18);
    color: #fc8181;
}

.lv-temperature-heading {
    margin: 0.25rem 0 0;
    font-size: 0.95rem;
}

.lv-temperature-heading i {
    margin-right: 0.4rem;
    color: #f6ad55;
}

.lv-temperature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}

.lv-temperature-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 7px;
    background: rgba(12, 18, 23, 0.86);
}

.lv-temperature-card span {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.75rem;
}

.lv-temperature-card.warning {
    border-color: rgba(252, 129, 129, 0.7);
}

.lv-temperature-card.warning small {
    color: #fc8181;
}

@media (max-width: 800px) {
    .lv-cells-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .lv-cells-battery-select {
        min-width: 0;
        width: 100%;
    }

    .lv-cells-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lv-cells-summary .lv-cells-updated {
        grid-column: 1 / -1;
        text-align: left;
    }

    .lv-cell-voltage-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lv-temperature-grid {
        grid-template-columns: 1fr;
    }
}
