@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;700&display=swap');

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-image:
        radial-gradient(at 10% 10%, rgba(99, 102, 241, 0.01) 0px, transparent 40%),
        radial-gradient(at 90% 90%, rgba(6, 182, 212, 0.01) 0px, transparent 40%),
        linear-gradient(rgba(0, 0, 0, 0.002) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.002) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 24px 24px, 24px 24px;
}

.font-tech { font-family: 'Space Grotesk', sans-serif; }

.glass-panel {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(230, 237, 245, 0.8);
    box-shadow: 0 4px 24px -2px rgba(15, 23, 42, 0.01), 0 1px 3px rgba(15, 23, 42, 0.005);
}

.topbar-shell {
    background:
        radial-gradient(circle at top left, rgba(99, 102, 241, 0.07), transparent 20%),
        radial-gradient(circle at top right, rgba(6, 182, 212, 0.06), transparent 18%),
        rgba(255, 255, 255, 0.9);
}

.topbar-brand {
    padding: 0.4rem 0.55rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(248, 250, 252, 0.82));
    border: 1px solid rgba(226, 232, 240, 0.58);
    box-shadow: 0 14px 28px -30px rgba(15, 23, 42, 0.24);
}

.topbar-brand-mark {
    box-shadow: 0 12px 22px -18px rgba(99, 102, 241, 0.28);
}

.topbar-brand-logo-wrap {
    width: 112px;
    height: 36px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.topbar-brand-logo {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.calibration-notice {
    display: none;
    align-items: center;
    gap: 0.45rem;
    margin: 0.35rem 0 0;
    padding: 0.55rem 1rem;
    border: 1px solid rgba(16, 185, 129, 0.22);
    border-radius: 0.75rem;
    background: rgba(236, 253, 245, 0.72);
    color: #166534;
    font-size: 0.78rem;
    line-height: 1.35;
}

.calibration-notice[aria-hidden="false"] { display: flex; }
.calibration-notice strong { text-transform: uppercase; letter-spacing: 0.08em; }

.calibration-notice-overlay {
    position: fixed;
    inset: 0;
    z-index: 71;
    justify-content: center;
    text-align: center;
    pointer-events: none;
    margin: 0;
    padding: 1rem;
    border: 0;
    border-radius: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(236,253,245,0.08));
    color: #166534;
    transition: opacity 180ms ease, visibility 180ms ease;
    opacity: 1;
    visibility: visible;
}

.calibration-notice-overlay[aria-hidden="true"] {
    opacity: 0;
    visibility: hidden;
}

.calibration-notice-overlay strong {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.05rem, 2.7vw, 2.2rem);
    font-weight: 900;
    line-height: 1.05;
}

.calibration-notice-overlay span {
    max-width: min(88%, 620px);
    font-size: clamp(0.78rem, 1.2vw, 1rem);
    font-weight: 700;
    line-height: 1.45;
}

.topbar-nav {
    padding: 0.35rem;
    border-radius: 1.15rem;
    background: rgba(248, 250, 252, 0.76);
    border: 1px solid rgba(226, 232, 240, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.topbar-link {
    position: relative;
}

.topbar-layout,
.topbar-brand-group,
.topbar-meta {
    min-width: 0;
}

.topbar-link-active {
    background: linear-gradient(135deg, rgba(238, 242, 255, 0.96), rgba(255, 255, 255, 0.92));
}

.topbar-link-alert-warning {
    animation: topbarAlertWarningPulse 1.35s ease-in-out infinite;
    border-color: rgba(249, 115, 22, 0.46) !important;
    color: #c2410c !important;
}

.topbar-link-alert-critical {
    animation: topbarAlertCriticalPulse 1.05s ease-in-out infinite;
    border-color: rgba(239, 68, 68, 0.5) !important;
    color: #dc2626 !important;
}

@keyframes topbarAlertWarningPulse {
    0%,
    100% {
        background: rgba(255, 255, 255, 0.92);
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
    }
    50% {
        background: rgba(255, 247, 237, 0.96);
        box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2), 0 14px 30px -24px rgba(249, 115, 22, 0.36);
    }
}

@keyframes topbarAlertCriticalPulse {
    0%,
    100% {
        background: rgba(255, 255, 255, 0.92);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
    50% {
        background: rgba(254, 242, 242, 0.98);
        box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.24), 0 16px 34px -24px rgba(239, 68, 68, 0.4);
    }
}

.soc-container { filter: drop-shadow(0 0 8px var(--soc-glow-color)); }
.soh-container { filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.12)); }

/* Compact phase readout kept inside the existing Grid/Consum card. */
.zy-grid-phase-summary {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid #f1f5f9;
    display: grid;
    gap: 2px;
    font-size: 9px;
    line-height: 1.15;
    color: #94a3b8;
}

.zy-grid-phase-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 12px;
}

.zy-grid-phase-row strong {
    color: #0f172a;
    font-weight: 750;
    white-space: nowrap;
}

.zy-load-phase-summary {
    margin-top: 3px;
}

.zy-load-phase-label {
    margin-top: 6px;
    color: #94a3b8;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.inverter-settings-open-button {
    border: 1px solid rgba(59, 130, 246, 0.28);
    border-radius: 0.65rem;
    background: #eff6ff;
    color: #1d4ed8;
    padding: 0.42rem 0.7rem;
    font-size: 0.7rem;
    font-weight: 750;
    white-space: nowrap;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.inverter-settings-open-button:hover {
    background: #dbeafe;
    border-color: rgba(37, 99, 235, 0.45);
    color: #1e40af;
}

.inverter-settings-tou-button {
    border-color: rgba(5, 150, 105, 0.28);
    background: #ecfdf5;
    color: #047857;
}

.inverter-settings-tou-button:hover {
    border-color: rgba(5, 150, 105, 0.5);
    background: #d1fae5;
    color: #065f46;
}

.inverter-tou-panel {
    border-top-color: rgba(5, 150, 105, 0.32);
}

.inverter-tou-dialog {
    max-width: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.inverter-tou-dialog .inverter-settings-dialog-header {
    align-items: center;
    margin-bottom: 0.7rem;
}

.inverter-settings-result:empty {
    display: none;
}

.inverter-tou-dialog .inverter-settings-dialog-header h2 {
    font-size: 1.05rem;
}

.inverter-tou-dialog .inverter-settings-dialog-header p:not(.section-kicker) {
    margin-top: 0.2rem;
    font-size: 0.68rem;
}

.inverter-tou-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0.8rem;
    border: 1px solid rgba(5, 150, 105, 0.22);
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.78);
}

.inverter-tou-intro > div:first-child {
    display: grid;
    gap: 0.2rem;
    color: #14532d;
    font-size: 0.75rem;
}

.inverter-tou-intro > div:first-child span {
    color: #64748b;
    font-size: 0.68rem;
}

.inverter-tou-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.55rem;
}

.inverter-tou-global-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.inverter-tou-global-card {
    display: grid;
    gap: 0.34rem;
    min-width: 0;
    margin: 0;
    padding: 0.55rem;
    border: 1px solid #dbeafe;
    border-radius: 0.8rem;
    background: rgba(255, 255, 255, 0.78);
    color: #334155;
    font-size: 0.66rem;
    font-weight: 800;
}

.inverter-tou-global-card small {
    color: #64748b;
    font-size: 0.57rem;
    font-weight: 600;
    line-height: 1.3;
}

.inverter-tou-control {
    width: 100%;
    min-width: 0;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #fff;
    color: #0f172a;
    padding: 0.45rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 750;
}

.inverter-tou-days legend {
    padding: 0;
    color: #334155;
    font-size: 0.7rem;
    font-weight: 800;
}

.inverter-tou-days > div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.38rem;
}

.inverter-tou-days label,
.inverter-tou-check {
    display: inline-flex !important;
    align-items: center;
    gap: 0.28rem;
    color: #475569 !important;
    font-size: 0.66rem !important;
    font-weight: 750 !important;
    white-space: nowrap;
}

.inverter-tou-days input,
.inverter-tou-check input {
    width: auto !important;
    accent-color: #059669;
}

.inverter-tou-rules {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
    margin-top: 0.6rem;
}

.inverter-tou-rule {
    padding: 0.6rem;
    border: 1px solid #dbeafe;
    border-left: 3px solid #10b981;
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.86);
}

.inverter-tou-rule-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
    color: #0f172a;
    font-size: 0.68rem;
}

.inverter-tou-rule-heading > div {
    display: flex;
    align-items: center;
    gap: 0.42rem;
}

.inverter-tou-rule-number {
    display: inline-grid;
    place-items: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    background: #059669;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 900;
}

.inverter-tou-rule-help {
    color: #64748b;
    font-size: 0.56rem;
    font-weight: 600;
}

.inverter-tou-rule-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 0.38rem;
}

.inverter-tou-rule-grid > label {
    min-width: 0;
    color: #475569;
    font-size: 0.6rem;
    font-weight: 800;
}

.inverter-tou-rule-grid label small {
    color: #94a3b8;
    font-size: 0.53rem;
    font-weight: 700;
}

.inverter-tou-rule-grid input[type="time"],
.inverter-tou-rule-grid input[type="text"],
.inverter-tou-rule-grid input[type="number"],
.inverter-tou-rule-grid select {
    width: 100%;
    min-width: 0;
    margin-top: 0.28rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #fff;
    color: #0f172a;
    padding: 0.36rem 0.4rem;
    font-size: 0.64rem;
    font-weight: 750;
}

.inverter-tou-rule-grid > label:nth-child(3),
.inverter-tou-charge-sources {
    grid-column: 1 / -1;
}

.inverter-tou-charge-sources {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 1.8rem;
    color: #64748b;
    font-size: 0.56rem;
    font-weight: 800;
}

.inverter-tou-charge-sources > span {
    margin-right: 0.12rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.inverter-tou-charge-sources .inverter-tou-check {
    color: #475569 !important;
    font-size: 0.58rem !important;
}

.inverter-tou-advanced {
    margin-top: 0.8rem;
}

.inverter-tou-advanced-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
    margin-top: 0.6rem;
    color: #64748b;
    font-size: 0.66rem;
}

.inverter-tou-advanced-grid strong {
    color: #334155;
}

.inverter-tou-note {
    margin: 0.55rem 0 0;
    color: #64748b;
    font-size: 0.6rem;
    line-height: 1.45;
}

.inverter-settings-inline {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e2e8f0;
}

.inverter-settings-inline[hidden] {
    display: none;
}

.inverter-settings-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(5px);
}

.inverter-settings-dialog {
    position: relative;
    width: 100%;
    max-height: none;
    overflow: auto;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 1.15rem;
    background: #f8fafc;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    padding: 1.25rem;
}

.inverter-settings-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.inverter-settings-dialog-header h2 {
    margin: 0.2rem 0 0;
    color: #0f172a;
    font-size: 1.25rem;
    font-weight: 800;
}

.inverter-settings-dialog-header p:not(.section-kicker) {
    margin: 0.35rem 0 0;
    color: #64748b;
    font-size: 0.78rem;
}

.inverter-settings-close {
    min-width: 5rem;
    height: 2rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.55rem;
    background: #fff;
    color: #475569;
    font-size: 0.68rem;
    font-weight: 800;
}

.inverter-settings-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
}

.inverter-settings-toolbar {
    display: flex;
    align-items: end;
    gap: 1rem;
    padding: 0.8rem;
    border: 1px solid #dbeafe;
    border-radius: 0.9rem;
    background: linear-gradient(135deg, #eff6ff, #f8fafc);
}

.inverter-settings-slave {
    width: 120px;
    flex: 0 0 120px;
}

.inverter-settings-toolbar-copy {
    display: grid;
    gap: 0.15rem;
    min-width: 180px;
    margin-right: auto;
    color: #1e3a8a;
    font-size: 0.74rem;
}

.inverter-settings-toolbar-copy span {
    color: #64748b;
    font-size: 0.68rem;
}

.inverter-settings-toolbar .inverter-settings-actions {
    margin-top: 0;
}

.inverter-settings-groups {
    display: grid;
    gap: 0.8rem;
    margin-top: 0.85rem;
}

.inverter-settings-group {
    padding: 0.85rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.95rem;
    background: #fff;
}

.inverter-settings-group-tou {
    border-color: rgba(5, 150, 105, 0.35);
    background: linear-gradient(135deg, #f0fdf4, #ffffff 58%);
    scroll-margin-top: 1.25rem;
}

.inverter-settings-group-tou .inverter-settings-group-heading h3 {
    color: #047857;
}

.inverter-settings-group-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.65rem;
}

.inverter-settings-group-heading h3 {
    margin: 0;
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 850;
}

.inverter-settings-group-heading p {
    margin: 0.18rem 0 0;
    color: #64748b;
    font-size: 0.68rem;
}

.inverter-settings-group-heading > span {
    flex: 0 0 auto;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.62rem;
    font-weight: 800;
}

.inverter-settings-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem;
}

.inverter-setting-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    padding: 0.52rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.7rem;
    background: #f8fafc;
}

.inverter-setting-card.is-readonly {
    background: #f8fafc;
    opacity: 0.78;
}

.inverter-setting-card-label {
    display: grid;
    gap: 0.16rem;
    min-width: 0;
}

.inverter-setting-card-label strong {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    overflow: hidden;
    color: #334155;
    font-size: 0.68rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inverter-setting-tooltip {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 0.85rem;
    height: 0.85rem;
    border: 1px solid #93c5fd;
    border-radius: 999px;
    color: #2563eb;
    font-size: 0.52rem;
    font-weight: 900;
}

.inverter-setting-card::after {
    position: absolute;
    z-index: 40;
    left: 0;
    bottom: calc(100% + 0.5rem);
    width: min(280px, calc(100vw - 2rem));
    padding: 0.62rem 0.72rem;
    border: 1px solid #bfdbfe;
    border-radius: 0.65rem;
    background: #0f172a;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.2);
    color: #e0f2fe;
    content: attr(data-inverter-tooltip);
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.35;
    opacity: 0;
    pointer-events: none;
    transform: translateY(0.25rem);
    transition: opacity 140ms ease, transform 140ms ease;
}

.inverter-setting-card:hover::after,
.inverter-setting-card:focus-within::after {
    opacity: 1;
    transform: translateY(0);
}

.inverter-setting-card-label small {
    overflow: hidden;
    color: #94a3b8;
    font-size: 0.58rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inverter-setting-value {
    min-width: 0;
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 0.48rem;
    background: #fff;
    color: #0f172a;
    padding: 0.42rem 0.45rem;
    font-size: 0.7rem;
    font-weight: 750;
}

.inverter-setting-value[data-inverter-setting-unavailable="1"] {
    border-color: #cbd5e1;
    background: #f1f5f9;
    color: #94a3b8;
}

.inverter-setting-value::placeholder {
    color: #94a3b8;
    font-weight: 700;
}

.inverter-settings-raw {
    margin-top: 0.85rem;
    border-top: 1px solid #e2e8f0;
    padding-top: 0.7rem;
}

.inverter-settings-raw summary {
    cursor: pointer;
    color: #475569;
    font-size: 0.7rem;
    font-weight: 800;
}

.inverter-settings-raw[open] summary {
    margin-bottom: 0.65rem;
}

.inverter-settings-form label {
    display: grid;
    gap: 0.3rem;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 750;
}

.inverter-settings-form input,
.inverter-settings-form textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 0.65rem;
    background: #fff;
    color: #0f172a;
    padding: 0.62rem 0.7rem;
    font: inherit;
    font-weight: 600;
}

.inverter-settings-form textarea {
    min-height: 7rem;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.78rem;
}

.inverter-settings-values-label {
    margin-top: 0.8rem;
}

.inverter-settings-hint {
    margin: 0.55rem 0 0;
    color: #64748b;
    font-size: 0.7rem;
    line-height: 1.4;
}

.inverter-settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
}

.inverter-settings-action {
    border: 0;
    border-radius: 0.7rem;
    padding: 0.68rem 0.9rem;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
}

.inverter-settings-action:disabled {
    cursor: wait;
    opacity: 0.55;
}

.inverter-settings-action-read { background: #2563eb; }
.inverter-settings-action-write { background: #059669; }

.inverter-settings-status {
    min-height: 1.25rem;
    margin-top: 0.8rem;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
}

.inverter-settings-status.is-error { color: #dc2626; }
.inverter-settings-status.is-success { color: #059669; }

.inverter-settings-result {
    max-height: 12rem;
    overflow: auto;
    margin: 0.6rem 0 0;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.7rem;
    background: #0f172a;
    color: #dbeafe;
    font-size: 0.7rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

@media (max-width: 560px) {
    .inverter-settings-fields { grid-template-columns: 1fr; }
    .inverter-settings-toolbar { align-items: stretch; flex-direction: column; }
    .inverter-settings-slave { width: auto; flex-basis: auto; }
    .inverter-settings-grid { grid-template-columns: 1fr; }
    .inverter-settings-toolbar-copy { margin-right: 0; }
    .inverter-settings-dialog { padding: 1rem; }
    .inverter-tou-intro { align-items: stretch; flex-direction: column; }
    .inverter-tou-actions { justify-content: flex-start; }
    .inverter-tou-global-grid { grid-template-columns: 1fr; }
    .inverter-tou-rules { grid-template-columns: 1fr; }
    .inverter-tou-advanced-grid { grid-template-columns: 1fr; }
}

@media (min-width: 561px) and (max-width: 900px) {
    .inverter-settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .inverter-settings-toolbar { flex-wrap: wrap; }
    .inverter-tou-global-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .inverter-tou-rules { grid-template-columns: 1fr; }
}
.scifi-grid { stroke: rgba(148, 163, 184, 0.12); stroke-dasharray: 2 2; }
.scifi-track { stroke: rgba(226, 232, 240, 0.8); stroke-dasharray: 4 2; }

.scifi-progress {
    stroke-dasharray: 4 2;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes liveValueUpdated {
    0% {
        opacity: 0.985;
    }
    100% {
        opacity: 1;
    }
}

.live-value-updated {
    animation: liveValueUpdated 120ms linear;
}

@keyframes socCriticalPulse {
    0% { opacity: 1; transform: scale(1); filter: drop-shadow(0 0 0 rgba(239, 68, 68, 0)); }
    50% { opacity: 0.78; transform: scale(1.035); filter: drop-shadow(0 0 16px rgba(239, 68, 68, 0.48)); }
    100% { opacity: 1; transform: scale(1); filter: drop-shadow(0 0 0 rgba(239, 68, 68, 0)); }
}

.soc-critical-pulse {
    animation: socCriticalPulse 1.05s ease-in-out infinite;
    will-change: transform, filter, opacity;
}

.soc-animate-progress { stroke: url(#scifiSocGradient); }
.soh-animate-progress { stroke: url(#scifiSohGradient); }
.cycle-animate-progress { stroke: url(#scifiCycleGradient); }

@keyframes spin-clockwise { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes spin-counterclockwise { 0% { transform: rotate(360deg); } 100% { transform: rotate(0deg); } }

.soc-scanner {
    transform-origin: center;
    stroke-dasharray: 35 165;
    animation: var(--soc-scanner-animation) linear infinite;
}

.soh-scanner {
    transform-origin: center;
    stroke-dasharray: 25 175;
    animation: spin-clockwise 14s linear infinite;
}

.status-card {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.85), rgba(241, 245, 249, 0.65));
}

.premium-strip {
    background:
        radial-gradient(circle at top left, rgba(99, 102, 241, 0.12), transparent 28%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.92));
}

@keyframes alertOrangePulse {
    0% {
        box-shadow: 0 4px 24px -2px rgba(15, 23, 42, 0.01), 0 1px 3px rgba(15, 23, 42, 0.005), inset 0 0 0 0 rgba(249, 115, 22, 0);
        border-color: rgba(226, 232, 240, 0.72);
        background-color: rgba(255, 255, 255, 0);
    }
    50% {
        box-shadow: 0 18px 38px -20px rgba(249, 115, 22, 0.28), 0 0 0 2px rgba(249, 115, 22, 0.42), inset 0 0 0 999px rgba(255, 247, 237, 0.26);
        border-color: rgba(249, 115, 22, 0.58);
        background-color: rgba(255, 247, 237, 0.42);
    }
    100% {
        box-shadow: 0 4px 24px -2px rgba(15, 23, 42, 0.01), 0 1px 3px rgba(15, 23, 42, 0.005), inset 0 0 0 0 rgba(249, 115, 22, 0);
        border-color: rgba(226, 232, 240, 0.72);
        background-color: rgba(255, 255, 255, 0);
    }
}

@keyframes alertRedPulse {
    0% {
        box-shadow: 0 4px 24px -2px rgba(15, 23, 42, 0.01), 0 1px 3px rgba(15, 23, 42, 0.005), inset 0 0 0 0 rgba(239, 68, 68, 0);
        border-color: rgba(226, 232, 240, 0.72);
        background-color: rgba(255, 255, 255, 0);
    }
    50% {
        box-shadow: 0 20px 40px -18px rgba(239, 68, 68, 0.30), 0 0 0 2px rgba(239, 68, 68, 0.52), inset 0 0 0 999px rgba(254, 242, 242, 0.34);
        border-color: rgba(239, 68, 68, 0.64);
        background-color: rgba(254, 242, 242, 0.46);
    }
    100% {
        box-shadow: 0 4px 24px -2px rgba(15, 23, 42, 0.01), 0 1px 3px rgba(15, 23, 42, 0.005), inset 0 0 0 0 rgba(239, 68, 68, 0);
        border-color: rgba(226, 232, 240, 0.72);
        background-color: rgba(255, 255, 255, 0);
    }
}

.dashboard-alert-pulse-orange {
    animation: alertOrangePulse 1.3s ease-in-out infinite;
    will-change: box-shadow, border-color, background-color;
}

.dashboard-alert-pulse-red {
    animation: alertRedPulse 1.05s ease-in-out infinite;
    will-change: box-shadow, border-color, background-color;
}

@keyframes veryLowSocTextPulse {
    0% { opacity: 0.42; letter-spacing: 0.34em; text-shadow: 0 0 0 rgba(239, 68, 68, 0); }
    50% { opacity: 1; letter-spacing: 0.4em; text-shadow: 0 0 20px rgba(239, 68, 68, 0.42); }
    100% { opacity: 0.42; letter-spacing: 0.34em; text-shadow: 0 0 0 rgba(239, 68, 68, 0); }
}

.very-low-soc-overlay {
    position: fixed;
    inset: 0;
    z-index: 72;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
    opacity: 1;
    visibility: visible;
    transition: opacity 180ms ease, visibility 180ms ease;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(254, 242, 242, 0.06));
    padding: 1rem;
}

.very-low-soc-overlay[aria-hidden="true"] {
    opacity: 0;
    visibility: hidden;
}

.emergency-stop-overlay {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(127, 29, 29, 0.08));
}

.very-low-soc-text {
    color: rgba(185, 28, 28, 0.82);
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.05rem, 2.7vw, 2.2rem);
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1.05;
    animation: veryLowSocTextPulse 1.05s ease-in-out infinite;
    user-select: none;
    max-width: min(92%, 780px);
}

.very-low-soc-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
}

.very-low-soc-subtext {
    color: rgba(127, 29, 29, 0.74);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(0.78rem, 1.2vw, 1rem);
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: 0.02em;
    max-width: min(88%, 620px);
}

.emergency-stop-text {
    color: rgba(127, 29, 29, 0.92);
    text-shadow: 0 0 24px rgba(127, 29, 29, 0.18);
}

.emergency-stop-subtext {
    color: rgba(127, 29, 29, 0.88);
    max-width: min(88%, 680px);
}

.parallel-dot {
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.08);
}

.trend-panel {
    background:
        radial-gradient(circle at top left, rgba(99, 102, 241, 0.045), transparent 24%),
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.04), transparent 24%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.9));
}

.trend-stage {
    border-radius: 1.15rem;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.32), rgba(255, 255, 255, 0.06));
    border: 1px solid rgba(226, 232, 240, 0.52);
}

.trend-stage canvas {
    position: relative;
    z-index: 3;
    width: 100% !important;
    height: 100% !important;
}

.trend-stage-glow,
.trend-stage-mesh {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.trend-stage-glow {
    z-index: 1;
    opacity: 0.8;
}

.trend-stage-glow-left {
    background: radial-gradient(circle at 12% 22%, rgba(99, 102, 241, 0.08), transparent 28%);
}

.trend-stage-glow-right {
    background: radial-gradient(circle at 84% 76%, rgba(16, 185, 129, 0.08), transparent 30%);
}

.trend-stage-mesh {
    z-index: 2;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px);
    background-size: 100% 58px, 88px 100%;
    mask-image: linear-gradient(180deg, rgba(15, 23, 42, 0.12), rgba(15, 23, 42, 0.04));
}

.trend-legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.38rem 0.72rem;
    border-radius: 999px;
    border: 1px solid rgba(226, 232, 240, 0.78);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 10px 20px -20px rgba(15, 23, 42, 0.26);
}

.trend-legend-swatch {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.86);
}

.trend-legend-chip-soc .trend-legend-swatch {
    background: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.trend-legend-chip-current .trend-legend-swatch {
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.trend-legend-chip-voltage .trend-legend-swatch {
    background: #334155;
    box-shadow: 0 0 0 4px rgba(51, 65, 85, 0.12);
}

.trend-hover-card {
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.84));
    border: 1px solid rgba(226, 232, 240, 0.72);
    border-radius: 0.95rem;
    padding: 0.7rem 0.82rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
    overflow: hidden;
}

.trend-hover-card::before {
    content: none;
    position: absolute;
    top: 0.7rem;
    left: 0.75rem;
    width: 0.18rem;
    height: 1.05rem;
    border-radius: 999px;
    opacity: 0.9;
}

.trend-hover-card-soc::before { background: linear-gradient(180deg, rgba(99, 102, 241, 0.95), rgba(129, 140, 248, 0.62)); }
.trend-hover-card-current::before { background: linear-gradient(180deg, rgba(16, 185, 129, 0.95), rgba(52, 211, 153, 0.62)); }
.trend-hover-card-voltage::before { background: linear-gradient(180deg, rgba(51, 65, 85, 0.95), rgba(100, 116, 139, 0.62)); }
.trend-hover-card-time::before { background: linear-gradient(180deg, rgba(148, 163, 184, 0.95), rgba(203, 213, 225, 0.62)); }
.trend-hover-card-power::before { background: linear-gradient(180deg, rgba(14, 165, 233, 0.95), rgba(103, 232, 249, 0.62)); }

.trend-empty-state {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 1.25rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(248, 250, 252, 0.16));
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: opacity 180ms ease, visibility 180ms ease;
}

.trend-empty-state[aria-hidden="true"] {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.trend-empty-state-title {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.trend-empty-state-copy {
    max-width: 34rem;
    color: #64748b;
    font-size: 0.84rem;
    line-height: 1.55;
    font-weight: 500;
}

.inverter-shell {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background:
        radial-gradient(circle at 16% 16%, rgba(99, 102, 241, 0.055), transparent 24%),
        radial-gradient(circle at 84% 78%, rgba(16, 185, 129, 0.05), transparent 22%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.92));
}

.inverter-topline {
    display: grid;
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
    gap: 0.9rem;
    align-items: start;
}

.inverter-status-cluster {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.inverter-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(226, 232, 240, 0.76);
    background: rgba(255, 255, 255, 0.92);
    color: #475569;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.inverter-status-badge-charging,
.inverter-status-badge-grid {
    color: #047857;
    border-color: rgba(16, 185, 129, 0.28);
    background: rgba(236, 253, 245, 0.95);
}

.inverter-status-badge-discharging {
    color: #1d4ed8;
    border-color: rgba(59, 130, 246, 0.26);
    background: rgba(239, 246, 255, 0.95);
}

.inverter-status-badge-idle,
.inverter-status-badge-nominal {
    color: #475569;
    border-color: rgba(203, 213, 225, 0.82);
    background: rgba(248, 250, 252, 0.96);
}

.inverter-status-badge-offline,
.inverter-status-badge-fault {
    color: #b91c1c;
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(254, 242, 242, 0.96);
}

.inverter-mini-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.inverter-mini-card {
    padding: 0.72rem 0.82rem;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.72);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.88));
}

.inverter-mini-value {
    margin-top: 0.4rem;
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.inverter-flow-card {
    border-radius: 1.35rem;
    border: 1px solid rgba(226, 232, 240, 0.74);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.9));
    padding: 1rem;
    overflow: hidden;
}

.inverter-flow-stage {
    position: relative;
    min-height: 430px;
}

.inverter-node {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 180px;
    padding: 1rem 1rem 0.95rem;
    border-radius: 1.2rem;
    border: 1px solid rgba(226, 232, 240, 0.72);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(248, 250, 252, 0.92));
    box-shadow: 0 18px 34px -30px rgba(15, 23, 42, 0.28);
    transition: transform 180ms ease, opacity 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.inverter-node.is-online {
    border-color: rgba(148, 163, 184, 0.34);
    box-shadow: 0 22px 44px -34px rgba(15, 23, 42, 0.24);
}

.inverter-node.is-muted {
    opacity: 0.62;
}

.inverter-node-grid { top: 2.2rem; left: 2rem; }
.inverter-node-battery { bottom: 2rem; left: 2rem; }
.inverter-node-inverter {
    top: 50%;
    left: 50%;
    min-width: 220px;
    transform: translate(-50%, -50%);
    z-index: 2;
}
.inverter-node-load { top: 50%; right: 2rem; transform: translateY(-50%); }

.inverter-node-icon {
    width: 2.15rem;
    height: 2.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.8rem;
    background: rgba(241, 245, 249, 0.9);
    color: #334155;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
    font-weight: 800;
}

.inverter-node-label {
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.inverter-node-value {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1;
}

.inverter-node-meta {
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.45;
    font-weight: 500;
}

.inverter-flow-line {
    position: absolute;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.92);
    overflow: hidden;
}

.inverter-flow-line-grid { top: 6.75rem; left: 14rem; width: calc(50% - 14rem); height: 0.32rem; }
.inverter-flow-line-battery-out { bottom: 8.4rem; left: 14rem; width: calc(50% - 14rem); height: 0.32rem; }
.inverter-flow-line-battery-in { bottom: 7.6rem; left: 14rem; width: calc(50% - 14rem); height: 0.2rem; opacity: 0.8; }
.inverter-flow-line-load { top: 50%; right: 14rem; width: calc(50% - 14rem); height: 0.32rem; transform: translateY(-50%); }

.inverter-flow-line::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(203, 213, 225, 0.18), rgba(148, 163, 184, 0.06));
}

.inverter-flow-line.is-active::after {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.24), rgba(16, 185, 129, 0.22));
}

.inverter-flow-dot {
    position: absolute;
    top: 50%;
    width: 0.65rem;
    height: 0.65rem;
    margin-top: -0.325rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffffff, #bfdbfe);
    box-shadow: 0 0 0 5px rgba(99, 102, 241, 0.08), 0 0 14px rgba(16, 185, 129, 0.22);
    opacity: 0;
}

.inverter-flow-line.is-active .inverter-flow-dot {
    opacity: 1;
    animation: inverterFlowForward 2.15s linear infinite;
}

.inverter-flow-line.is-reverse .inverter-flow-dot {
    animation-name: inverterFlowReverse;
}

.inverter-flow-line .inverter-flow-dot:nth-child(2) { animation-delay: 0.72s; }
.inverter-flow-line .inverter-flow-dot:nth-child(3) { animation-delay: 1.44s; }

@keyframes inverterFlowForward {
    0% { left: -2%; opacity: 0; }
    12% { opacity: 1; }
    88% { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}

@keyframes inverterFlowReverse {
    0% { left: 100%; opacity: 0; }
    12% { opacity: 1; }
    88% { opacity: 1; }
    100% { left: -2%; opacity: 0; }
}

@media (max-width: 1180px) {
    .inverter-topline {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 900px) {
    .inverter-flow-stage {
        min-height: 640px;
    }

    .inverter-node-grid,
    .inverter-node-battery,
    .inverter-node-inverter,
    .inverter-node-load {
        min-width: 0;
        width: calc(100% - 2rem);
        left: 1rem;
        right: 1rem;
        transform: none;
    }

    .inverter-node-grid { top: 1rem; }
    .inverter-node-inverter { top: 12.7rem; }
    .inverter-node-load { top: 24.4rem; }
    .inverter-node-battery { top: 36.1rem; bottom: auto; }

    .inverter-flow-line-grid,
    .inverter-flow-line-battery-out,
    .inverter-flow-line-battery-in,
    .inverter-flow-line-load {
        left: 50%;
        right: auto;
        width: 0.32rem;
        height: 4.1rem;
        transform: translateX(-50%);
    }

    .inverter-flow-line-grid { top: 7.2rem; }
    .inverter-flow-line-load { top: 19rem; }
    .inverter-flow-line-battery-out { top: 30.6rem; bottom: auto; }
    .inverter-flow-line-battery-in { top: 30.6rem; bottom: auto; left: calc(50% + 0.65rem); width: 0.2rem; }

    .inverter-flow-dot {
        left: 50%;
        margin-left: -0.325rem;
        margin-top: 0;
    }

    .inverter-flow-line.is-active .inverter-flow-dot {
        animation-name: inverterFlowDown;
    }

    .inverter-flow-line.is-reverse .inverter-flow-dot {
        animation-name: inverterFlowUp;
    }
}

@keyframes inverterFlowDown {
    0% { top: -2%; opacity: 0; }
    12% { opacity: 1; }
    88% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

@keyframes inverterFlowUp {
    0% { top: 100%; opacity: 0; }
    12% { opacity: 1; }
    88% { opacity: 1; }
    100% { top: -2%; opacity: 0; }
}

.settings-form-panel {
    box-shadow: 0 12px 30px -28px rgba(15, 23, 42, 0.18);
}

.settings-beta-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    padding: 0.75rem 0.85rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(226, 232, 240, 0.82);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.84));
}

.settings-beta-copy {
    min-width: 0;
}

.settings-beta-subtext {
    margin: 0.28rem 0 0;
    color: #64748b;
    font-size: 0.77rem;
    line-height: 1.5;
}

.settings-summary-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 180px)) auto;
    gap: 0.55rem;
    align-items: stretch;
}

.settings-reserve-shell {
    display: grid;
    grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
    gap: 0.6rem;
    margin-bottom: 0.7rem;
}

.settings-reserve-card,
.settings-limit-card {
    padding: 0.7rem 0.8rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(226, 232, 240, 0.82);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.84));
}

.settings-reserve-head,
.settings-limit-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.settings-reserve-value-wrap {
    display: flex;
    align-items: end;
    gap: 0.35rem;
    margin-top: 0.22rem;
}

.settings-reserve-kwh-input {
    width: 5.1rem;
    border: 0;
    background: transparent;
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1;
    outline: none;
    padding: 0;
}

.settings-reserve-unit {
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 0.1rem;
}

.settings-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
}

.settings-reserve-toggle-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.38rem;
}

.settings-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.settings-toggle-track {
    position: relative;
    width: 2.4rem;
    height: 1.35rem;
    border-radius: 999px;
    background: rgba(203, 213, 225, 0.9);
    transition: background-color 140ms ease;
}

.settings-toggle-thumb {
    position: absolute;
    top: 0.13rem;
    left: 0.13rem;
    width: 1.08rem;
    height: 1.08rem;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 6px 16px -10px rgba(15, 23, 42, 0.45);
    transition: transform 140ms ease;
}

.settings-toggle input[type="checkbox"]:checked + .settings-toggle-track {
    background: linear-gradient(135deg, #10b981, #06b6d4);
}

.settings-toggle input[type="checkbox"]:checked + .settings-toggle-track .settings-toggle-thumb {
    transform: translateX(1.05rem);
}

.settings-toggle-label {
    color: #475569;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.settings-reserve-save-button {
    min-width: 4.15rem;
    height: 1.48rem;
    padding: 0 0.72rem;
    border: 1px solid rgba(79, 70, 229, 0.18);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(99, 102, 241, 0.18));
    color: #4f46e5;
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    box-shadow: 0 10px 22px -18px rgba(79, 70, 229, 0.38);
    transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.settings-reserve-save-button:hover {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    border-color: #4f46e5;
    color: #ffffff;
    transform: translateY(-1px);
}

.settings-limit-legend {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    color: #94a3b8;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.settings-dual-range {
    position: relative;
    height: 2.3rem;
    margin-top: 0.45rem;
}

.settings-dual-range-track,
.settings-dual-range-fill {
    position: absolute;
    left: 0;
    right: 0;
    top: 0.95rem;
    height: 0.38rem;
    border-radius: 999px;
}

.settings-dual-range-track {
    background: rgba(203, 213, 225, 0.92);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.settings-dual-range-fill-reserve {
    background: linear-gradient(90deg, #fb923c, #ea580c);
    box-shadow: 0 0 0 1px rgba(194, 65, 12, 0.1), 0 6px 14px -8px rgba(234, 88, 12, 0.55);
}

.settings-dual-range-fill-charge {
    background: linear-gradient(90deg, #34d399, #059669);
    box-shadow: 0 0 0 1px rgba(5, 150, 105, 0.1), 0 6px 14px -8px rgba(5, 150, 105, 0.45);
}

.settings-range {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 2.3rem;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    pointer-events: none;
}

.settings-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1.36rem;
    height: 1.82rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(15, 23, 42, 0.16);
    box-shadow: 0 14px 26px -12px rgba(15, 23, 42, 0.38);
    pointer-events: auto;
    cursor: pointer;
}

.settings-range::-moz-range-thumb {
    width: 1.36rem;
    height: 1.82rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(15, 23, 42, 0.16);
    box-shadow: 0 14px 26px -12px rgba(15, 23, 42, 0.38);
    pointer-events: auto;
    cursor: pointer;
}

.settings-range-reserve::-webkit-slider-thumb,
.settings-range-reserve::-moz-range-thumb {
    background: linear-gradient(180deg, #fca5a5, #dc2626);
}

.settings-range-charge::-webkit-slider-thumb,
.settings-range-charge::-moz-range-thumb {
    background: linear-gradient(180deg, #6ee7b7, #059669);
}

.settings-range::-webkit-slider-runnable-track,
.settings-range::-moz-range-track {
    background: transparent;
}

.settings-dual-range-values {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.2rem;
}

.settings-dual-range-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
    padding: 0.42rem 0.58rem;
    border-radius: 0.72rem;
    background: rgba(248, 250, 252, 0.82);
    border: 1px solid rgba(226, 232, 240, 0.72);
}

.settings-dual-range-chip-reserve {
    background: linear-gradient(180deg, rgba(255, 247, 237, 0.92), rgba(255, 255, 255, 0.9));
    border-color: rgba(251, 146, 60, 0.22);
}

.settings-dual-range-chip-charge {
    background: linear-gradient(180deg, rgba(236, 253, 245, 0.92), rgba(255, 255, 255, 0.9));
    border-color: rgba(52, 211, 153, 0.22);
}

.settings-dual-range-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 5.1rem;
    padding: 0.34rem 0.58rem;
    border-radius: 999px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    line-height: 1;
}

.settings-dual-range-badge-reserve {
    color: #c2410c;
    background: rgba(255, 237, 213, 0.96);
    border: 1px solid rgba(251, 146, 60, 0.24);
}

.settings-dual-range-badge-charge {
    color: #047857;
    background: rgba(209, 250, 229, 0.96);
    border: 1px solid rgba(52, 211, 153, 0.24);
}

.settings-dual-range-chip strong {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.82rem;
    font-weight: 800;
}

.settings-summary-card {
    min-width: 0;
    padding: 0.55rem 0.72rem;
    border-radius: 0.85rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.84));
    border: 1px solid rgba(226, 232, 240, 0.82);
    box-shadow: 0 10px 26px -28px rgba(15, 23, 42, 0.26);
}

.settings-summary-value {
    margin-top: 0.2rem;
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1;
}

.settings-sync-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.46rem 0.72rem;
    border-radius: 999px;
    background: rgba(248, 250, 252, 0.84);
    border: 1px solid rgba(226, 232, 240, 0.8);
    color: #475569;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    font-family: 'Space Grotesk', sans-serif;
    justify-self: end;
    align-self: center;
}

.settings-sync-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.settings-group-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.82));
    border: 1px solid rgba(226, 232, 240, 0.74);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    min-width: 0;
    padding: 0.72rem !important;
}

.settings-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.settings-field-shell {
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
    min-width: 0;
}

.settings-channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.5rem;
}

.settings-channel-card {
    min-width: 0;
    padding: 0.52rem;
    border-radius: 0.78rem;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.88), rgba(241, 245, 249, 0.76));
    border: 1px solid rgba(226, 232, 240, 0.82);
}

.settings-channel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    margin-bottom: 0.42rem;
}

.settings-channel-title {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.settings-channel-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.44rem;
}

.settings-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.settings-input {
    width: 100%;
    height: 2.15rem;
    border-radius: 0.72rem;
    border: 1px solid rgba(203, 213, 225, 0.9);
    background: rgba(255, 255, 255, 0.9);
    color: #0f172a;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0 0.7rem;
    outline: none;
    transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.settings-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #64748b 50%),
        linear-gradient(135deg, #64748b 50%, transparent 50%);
    background-position:
        calc(100% - 16px) calc(50% - 3px),
        calc(100% - 11px) calc(50% - 3px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 1.9rem;
}

.settings-input:focus {
    border-color: rgba(99, 102, 241, 0.42);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.08);
    background: rgba(255, 255, 255, 0.98);
}

.settings-input-unit {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    pointer-events: none;
}

.settings-input-with-unit {
    padding-right: 3.1rem;
}

.settings-action-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.65rem;
}

.settings-global-action-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 0.85rem;
    padding-top: 0.72rem;
    border-top: 1px solid rgba(226, 232, 240, 0.86);
}

.settings-main-layout {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 0.75rem;
    align-items: stretch;
    margin-top: 0.25rem;
}

.settings-io-column,
.settings-groups-column,
.settings-rules-panel {
    min-width: 0;
}

.settings-io-column {
    display: grid;
    gap: 0.75rem;
    align-content: start;
}

.settings-io-led-panel {
    display: grid;
    gap: 0.42rem;
    padding: 0.56rem 0.62rem;
    border-radius: 0.76rem;
    border: 1px solid rgba(226, 232, 240, 0.82);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.88));
    box-shadow: 0 10px 22px -24px rgba(15, 23, 42, 0.16);
}

.settings-io-led-row {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 0.52rem;
    align-items: center;
}

.settings-io-led-label {
    color: #64748b;
    font-size: 0.54rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-family: 'Space Grotesk', sans-serif;
}

.settings-io-led-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.34rem 0.46rem;
    align-items: center;
}

.settings-io-led-item {
    display: inline-flex;
    align-items: center;
    gap: 0.24rem;
}

.settings-io-led-dot {
    width: 0.62rem;
    height: 0.62rem;
    border-radius: 999px;
    background: #cbd5e1;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.28);
    transition: background-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.settings-io-led-dot.is-active {
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12), 0 0 12px rgba(16, 185, 129, 0.32);
}

.settings-io-led-index {
    color: #475569;
    font-size: 0.56rem;
    font-weight: 700;
    line-height: 1;
}

.settings-loss-panel {
    display: grid;
    gap: 0.34rem;
    padding: 0.56rem 0.62rem;
    border-radius: 0.76rem;
    border: 1px solid rgba(226, 232, 240, 0.82);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.88));
    box-shadow: 0 10px 22px -24px rgba(15, 23, 42, 0.16);
}

.settings-loss-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(118px, 148px);
    gap: 0.38rem;
    align-items: center;
}

.settings-loss-copy {
    min-width: 0;
}

.settings-loss-label {
    color: #475569;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.2;
}

.settings-loss-input-wrap {
    min-width: 0;
}

.settings-loss-input-wrap .settings-input-unit {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
    right: 0.62rem;
}

.settings-loss-input {
    height: 1.54rem;
    padding-left: 0.5rem;
    padding-right: 2.4rem;
    font-size: 0.62rem;
}

.settings-loss-save-button {
    width: 100%;
    height: 1.54rem;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 0.34rem;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.52rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.settings-loss-save-button:hover {
    background: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
}

.settings-rules-panel {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 0.72rem 0.76rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(226, 232, 240, 0.82);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.88));
    box-shadow: 0 10px 22px -24px rgba(15, 23, 42, 0.16);
}

.settings-rules-panel.rules-state-healthy {
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.14), 0 0 22px -12px rgba(16, 185, 129, 0.28), 0 10px 22px -24px rgba(15, 23, 42, 0.16);
}

.settings-rules-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.62rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #f1f5f9;
}

.settings-rules-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
}

.settings-rules-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.2rem;
    padding: 0 0.42rem;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.52rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.settings-rules-head-button {
    height: 1.56rem;
    padding: 0 0.62rem;
    border-radius: 0.42rem;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #475569;
    font-size: 0.54rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.settings-rules-head-button:hover {
    background: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
}

.settings-rules-table {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    border: 1px solid #e2e8f0;
    border-radius: 0.7rem;
    background: #f8fafc;
    overflow: hidden;
}

.settings-rules-table-head {
    display: grid;
    grid-template-columns: var(--settings-rules-cols, minmax(220px, 1.6fr) minmax(86px, 0.6fr));
    gap: 0.18rem;
    padding: 0.4rem 0.42rem;
    border-bottom: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.92);
    color: #94a3b8;
    font-size: 0.42rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    align-items: center;
}

.settings-rules-body {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    flex-direction: column;
    justify-content: space-between;
    overflow: auto;
    padding: 0.32rem 0.28rem;
    gap: 0.22rem;
}

.settings-rules-row {
    display: grid;
    grid-template-columns: var(--settings-rules-cols, minmax(220px, 1.6fr) minmax(86px, 0.6fr));
    gap: 0.18rem;
    align-items: center;
}

.settings-rules-row {
    flex: 1 0 auto;
    padding: 0.12rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #e2e8f0;
}

.settings-rules-row:hover {
    background: #ffffff;
    border-color: #cbd5e1;
}

.settings-rules-row.rule-state-warning {
    background: linear-gradient(180deg, rgba(255, 247, 237, 0.96), rgba(255, 255, 255, 0.94));
    border-color: rgba(249, 115, 22, 0.32);
}

.settings-rules-row.rule-state-trigger {
    background: linear-gradient(180deg, rgba(254, 242, 242, 0.98), rgba(255, 255, 255, 0.94));
    border-color: rgba(239, 68, 68, 0.34);
}

@keyframes rulesCriticalPulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
        border-color: rgba(239, 68, 68, 0.34);
    }
    50% {
        box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.18), 0 14px 24px -18px rgba(239, 68, 68, 0.34);
        border-color: rgba(239, 68, 68, 0.62);
    }
}

.settings-rules-row.rule-state-active {
    animation: rulesCriticalPulse 1.05s ease-in-out infinite;
}

/* Keep protection rows visually neutral; state handling remains in firmware/UI logic. */
.settings-rules-row.rule-state-warning,
.settings-rules-row.rule-state-trigger,
.settings-rules-row.rule-state-active {
    background: rgba(255, 255, 255, 0.92);
    border-color: #e2e8f0;
    animation: none;
}

.settings-rules-description {
    min-width: 0;
    height: 1.36rem;
    color: #0f172a;
    display: flex;
    align-items: center;
}

.settings-rules-description {
    padding: 0 0.38rem;
    font-size: 0.56rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.settings-rules-input,
.settings-rules-select {
    width: 100%;
    height: 1.36rem;
    padding: 0 0.24rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.25rem;
    background: #ffffff;
    color: #0f172a;
    font-size: 0.52rem;
    font-weight: 700;
    outline: none;
}

.settings-rules-input:focus,
.settings-rules-select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.settings-rules-input:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    border-color: #cbd5e1;
}

.settings-rules-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 0.86rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.14rem center;
    background-repeat: no-repeat;
    background-size: 0.72em;
    cursor: pointer;
}

.settings-rules-default-row {
    margin-top: 0.04rem;
}

.settings-rules-save-button {
    width: 100%;
    height: 1.36rem;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 0.25rem;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.5rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.settings-rules-save-button:hover {
    background: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
}

@media (max-width: 1535px) {
    .settings-rules-table {
        overflow: auto;
    }

    .settings-rules-table-head,
    .settings-rules-row {
        min-width: 420px;
    }
}

.settings-io-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
    margin-top: 0.2rem;
}

.settings-io-panel {
    min-width: 0;
    padding: 0.56rem;
    border-radius: 0.76rem;
    border: 1px solid rgba(226, 232, 240, 0.82);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.88));
    box-shadow: 0 10px 22px -24px rgba(15, 23, 42, 0.16);
}

@media (max-width: 1279px) {
    .settings-main-layout {
        grid-template-columns: 1fr;
    }
}


.settings-io-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    margin-bottom: 0.4rem;
    padding-bottom: 0.28rem;
    border-bottom: 1px solid #f1f5f9;
}

.settings-io-title {
    font-size: 0.64rem;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-family: 'Space Grotesk', sans-serif;
}

.settings-io-count-badge {
    background: #e0e7ff;
    color: #4f46e5;
    font-size: 0.52rem;
    font-weight: 800;
    padding: 0.08rem 0.34rem;
    border-radius: 999px;
}

.settings-io-list {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.settings-io-row {
    display: grid;
    grid-template-columns: minmax(88px, 108px) 28px minmax(0, 1fr);
    gap: 0.34rem;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.42rem;
    padding: 0.22rem 0.28rem;
    transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.settings-io-row:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 4px 14px -12px rgba(15, 23, 42, 0.18);
}

.settings-locked-block {
    opacity: 0.56;
}

.settings-locked-block,
.settings-locked-block * {
    cursor: not-allowed !important;
}

.settings-locked-block input:disabled,
.settings-locked-block select:disabled,
.settings-locked-block button:disabled {
    opacity: 0.9;
}

.access-locked-tooltip {
    position: relative;
}

.access-locked-tooltip::after {
    content: attr(data-lock-message);
    position: absolute;
    top: 0.9rem;
    right: 1rem;
    transform: translateY(-0.35rem);
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.94);
    color: #f8fafc;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 14px 34px -18px rgba(15, 23, 42, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 30;
}

.access-locked-tooltip:hover::after {
    opacity: 1;
    transform: translateY(0);
}

.settings-io-name-cell {
    display: grid;
    min-width: 0;
}

.settings-io-name-text {
    display: block;
    width: 100%;
    padding: 0 0.1rem;
    font-size: 0.62rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.settings-io-select {
    width: 100%;
    height: 1.54rem;
    padding: 0 1.2rem 0 0.4rem;
    font-size: 0.61rem;
    font-weight: 700;
    border: 1px solid #cbd5e1;
    border-radius: 0.34rem;
    background: #ffffff;
    color: #0f172a;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #64748b 50%),
        linear-gradient(135deg, #64748b 50%, transparent 50%);
    background-position:
        calc(100% - 10px) calc(50% - 2px),
        calc(100% - 6px) calc(50% - 2px);
    background-size: 4px 4px, 4px 4px;
    background-repeat: no-repeat;
    cursor: pointer;
}

.settings-io-select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
}

.settings-io-toggle {
    position: relative;
    display: inline-flex;
    width: 22px;
    height: 12px;
    align-items: center;
    justify-content: center;
}

.settings-io-toggle input[type="hidden"] + input[type="checkbox"],
.settings-io-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.settings-io-toggle-slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: #cbd5e1;
    border-radius: 999px;
    transition: background-color 140ms ease;
}

.settings-io-toggle-slider::before {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    left: 2px;
    bottom: 2px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    transition: transform 140ms ease;
}

.settings-io-toggle input[type="checkbox"]:checked + .settings-io-toggle-slider {
    background: #10b981;
}

.settings-io-toggle input[type="checkbox"]:checked + .settings-io-toggle-slider::before {
    transform: translateX(10px);
}

.settings-io-save-button {
    width: 100%;
    height: 1.54rem;
    padding: 0;
    font-size: 0.54rem;
    font-weight: 800;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 0.34rem;
    cursor: pointer;
    transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.settings-io-save-button:hover {
    background: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
}

.settings-save-button {
    min-width: 8.6rem;
    height: 2.3rem;
    padding: 0 1rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(15, 23, 42, 0.04);
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #fff;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    box-shadow: 0 18px 32px -26px rgba(15, 23, 42, 0.58);
    transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.settings-form-panel .performance-label,
.settings-summary-card .performance-label {
    font-size: 0.54rem;
    letter-spacing: 0.18em;
}

.reserve-energy-overlay {
    position: fixed;
    inset: 0;
    z-index: 71;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 1;
    visibility: visible;
    transition: opacity 180ms ease, visibility 180ms ease;
    padding: 1rem;
}

.reserve-energy-overlay[aria-hidden="true"] {
    opacity: 0;
    visibility: hidden;
}

.reserve-energy-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    text-align: center;
}

.reserve-energy-text {
    color: rgba(5, 150, 105, 0.9);
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(0.92rem, 1.6vw, 1.45rem);
    font-weight: 900;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    animation: veryLowSocTextPulse 1.35s ease-in-out infinite;
}

.reserve-energy-subtext {
    color: rgba(6, 95, 70, 0.82);
    font-size: clamp(0.72rem, 1vw, 0.9rem);
    font-weight: 700;
    line-height: 1.35;
    max-width: min(88%, 560px);
}

.reserve-mains-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.72rem;
    padding: 0.72rem 0.9rem;
    border-radius: 1rem;
    border: 1px solid rgba(16, 185, 129, 0.22);
    background: linear-gradient(180deg, rgba(236, 253, 245, 0.94), rgba(255, 255, 255, 0.92));
    box-shadow: 0 18px 36px -28px rgba(5, 150, 105, 0.36);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    opacity: 1;
    visibility: visible;
    transition: opacity 180ms ease, visibility 180ms ease, transform 180ms ease;
}

.reserve-mains-badge-inline {
    justify-self: start;
    align-self: center;
    max-width: min(100%, 430px);
    margin-left: 0.2rem;
}

.reserve-mains-badge[aria-hidden="true"] {
    display: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    pointer-events: none;
}

.reserve-mains-badge-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #10b981, #22c55e);
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.12);
    flex: 0 0 auto;
}

.reserve-mains-badge-copy {
    display: flex;
    flex-direction: column;
    gap: 0.14rem;
}

.reserve-mains-badge-title {
    color: #065f46;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.reserve-mains-badge-subtext {
    color: #047857;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.35;
}

.settings-save-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 22px 38px -24px rgba(15, 23, 42, 0.5);
}

.settings-save-button:disabled {
    opacity: 0.62;
    cursor: wait;
}

.settings-modal-panel {
    max-width: 30rem;
}

@media (max-width: 980px) {
    .settings-reserve-shell {
        grid-template-columns: 1fr;
    }

    .settings-beta-toggle-row {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .settings-sync-chip {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

@media (max-width: 640px) {
    .settings-summary-row {
        grid-template-columns: 1fr;
    }

    .settings-sync-chip {
        width: fit-content;
    }
}

.performance-card {
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.72);
    background: rgba(255, 255, 255, 0.82);
    padding: 0.9rem 1rem;
    min-height: 92px;
    box-shadow: 0 16px 32px -28px rgba(15, 23, 42, 0.32);
}

.performance-card-compact {
    padding: 0.75rem 0.85rem;
    min-height: 78px;
    border-radius: 0.9rem;
}

.performance-hero-value {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.4rem;
    font-weight: 900;
    line-height: 1;
}

.performance-hero-unit {
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

/* Fit long operating states inside the compact current/status column. */
.dashboard-stat-time {
    container-type: inline-size;
    overflow: hidden;
}

#liveTimeEstimateValue {
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    letter-spacing: -0.04em;
    font-size: clamp(1rem, 1.45vw, 1.875rem);
    font-size: clamp(1rem, 13cqw, 1.875rem);
}

@media (max-width: 1480px) and (min-width: 992px) {
    body {
        padding: 0.8rem;
        gap: 0.8rem;
    }

    .glass-panel {
        box-shadow: 0 3px 18px -6px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
    }

    .topbar-shell {
        padding: 0.85rem 0.95rem;
    }

    .topbar-nav {
        padding: 0.25rem;
        gap: 0.2rem;
    }

    .topbar-link {
        padding: 0.48rem 0.72rem !important;
        font-size: 0.72rem !important;
    }

    .performance-card {
        padding: 0.75rem 0.82rem;
        min-height: 80px;
    }

    .performance-card-compact {
        padding: 0.62rem 0.72rem;
        min-height: 68px;
    }

    .performance-hero-value {
        font-size: 1.12rem;
    }

    .performance-hero-unit {
        font-size: 0.66rem;
    }

    .energy-value {
        font-size: 1.08rem;
    }

    .energy-value-strong {
        font-size: 1.18rem;
    }

    .metric-xl {
        font-size: 1.9rem;
    }

    .metric-lg {
        font-size: 1.45rem;
    }

    .metric-md {
        font-size: 1.05rem;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .alerts-item,
    .alerts-timeline-item,
    .diagnostics-mini-card,
    .settings-group-card {
        padding: 0.8rem 0.85rem;
    }

    .settings-channel-card {
        padding: 0.72rem;
    }

    .settings-input {
        height: 2.55rem;
        font-size: 0.76rem;
    }

    .settings-summary-card {
        min-height: 72px;
        padding: 0.72rem 0.8rem;
    }

    .settings-summary-value {
        font-size: 1.02rem;
    }
}

@media (max-width: 1199px) and (min-width: 768px) {
    .topbar-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .topbar-brand-group {
        justify-self: center;
        width: 100%;
        align-items: center;
        padding-left: 0;
    }

    .topbar-nav {
        justify-self: center;
        width: 100%;
        justify-content: center;
    }

    .topbar-meta {
        display: none !important;
    }

    .energy-single-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.performance-card-indigo {
    background: linear-gradient(180deg, rgba(238, 242, 255, 0.92), rgba(255, 255, 255, 0.86));
}

.performance-card-emerald {
    background: linear-gradient(180deg, rgba(236, 253, 245, 0.92), rgba(255, 255, 255, 0.86));
}

.performance-card-cyan {
    background: linear-gradient(180deg, rgba(236, 254, 255, 0.92), rgba(255, 255, 255, 0.86));
}

.performance-card-slate {
    background: linear-gradient(180deg, rgba(241, 245, 249, 0.95), rgba(255, 255, 255, 0.86));
}

.performance-card-amber {
    background: linear-gradient(180deg, rgba(255, 251, 235, 0.95), rgba(255, 255, 255, 0.86));
}

.alerts-hero-panel {
    background:
        radial-gradient(circle at top left, rgba(248, 113, 113, 0.05), transparent 22%),
        radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.04), transparent 24%),
        rgba(255, 255, 255, 0.88);
}

.alerts-system-pill {
    display: inline-flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 170px;
    padding: 0.75rem 0.95rem;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    background: rgba(255, 255, 255, 0.86);
}

.alerts-system-pill-value {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 900;
    line-height: 1.05;
}

.alerts-status-rose {
    box-shadow: 0 18px 36px -30px rgba(239, 68, 68, 0.28);
}

.alerts-status-amber {
    box-shadow: 0 18px 36px -30px rgba(245, 158, 11, 0.28);
}

.alerts-status-cyan {
    box-shadow: 0 18px 36px -30px rgba(6, 182, 212, 0.24);
}

.alerts-status-emerald {
    box-shadow: 0 18px 36px -30px rgba(16, 185, 129, 0.24);
}

.alerts-card-critical {
    background: linear-gradient(180deg, rgba(254, 242, 242, 0.95), rgba(255, 255, 255, 0.88));
}

.alerts-summary-trigger {
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease;
}

.alerts-summary-trigger:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 34px -28px rgba(15, 23, 42, 0.24);
}

.alerts-list-panel,
.alerts-side-panel {
    background:
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.04), transparent 20%),
        rgba(255, 255, 255, 0.88);
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.alerts-item {
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.76);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.92));
    box-shadow: 0 18px 32px -32px rgba(15, 23, 42, 0.24);
}

.alerts-item-critical {
    border-color: rgba(239, 68, 68, 0.2);
    background: linear-gradient(180deg, rgba(254, 242, 242, 0.96), rgba(255, 255, 255, 0.92));
}

.alerts-item-warning {
    border-color: rgba(245, 158, 11, 0.22);
    background: linear-gradient(180deg, rgba(255, 251, 235, 0.96), rgba(255, 255, 255, 0.92));
}

.alerts-item-info {
    border-color: rgba(6, 182, 212, 0.18);
    background: linear-gradient(180deg, rgba(236, 254, 255, 0.96), rgba(255, 255, 255, 0.92));
}

.alerts-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.alerts-item-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
}

.alerts-item-dot {
    width: 0.55rem;
    height: 0.55rem;
    margin-top: 0.42rem;
    border-radius: 999px;
    background: #0f172a;
    flex: 0 0 auto;
}

.alerts-item-critical .alerts-item-dot {
    background: #ef4444;
}

.alerts-item-warning .alerts-item-dot {
    background: #f59e0b;
}

.alerts-item-info .alerts-item-dot {
    background: #06b6d4;
}

.alerts-item-title {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.1;
}

.alerts-item-meta {
    margin-top: 0.18rem;
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.alerts-item-badge {
    padding: 0.35rem 0.5rem;
    border-radius: 999px;
    color: #334155;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    background: rgba(241, 245, 249, 0.9);
}

.alerts-item-copy {
    margin-top: 0.65rem;
    color: #475569;
    font-size: 0.92rem;
    line-height: 1.55;
}

.alerts-item-action {
    margin-top: 0.55rem;
    color: #0f172a;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.5;
}

.alerts-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.alerts-timeline-item {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 0.8rem;
    align-items: start;
    padding: 0.8rem 0.85rem;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.76);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.92));
}

.alerts-timeline-time {
    color: #94a3b8;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.alerts-timeline-title {
    color: #0f172a;
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.25;
}

.alerts-timeline-copy {
    margin-top: 0.28rem;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.5;
}

.alerts-empty-state {
    padding: 1rem;
    border-radius: 1rem;
    border: 1px dashed rgba(203, 213, 225, 0.86);
    background: rgba(248, 250, 252, 0.6);
}

.alerts-empty-state-side {
    min-height: 140px;
}

.alerts-empty-title {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 800;
}

.alerts-empty-copy {
    margin-top: 0.35rem;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
}

.alerts-filter-modal-panel {
    width: min(760px, 100%);
}

.alerts-filter-modal-body {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: min(72vh, 760px);
    overflow: auto;
}

.alerts-filter-item {
    padding: 1rem 1rem 1.05rem;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.76);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
    box-shadow: 0 18px 32px -32px rgba(15, 23, 42, 0.24);
}

.alerts-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
    margin-top: 0.85rem;
}

.alerts-filter-block {
    padding: 0.8rem 0.85rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(226, 232, 240, 0.68);
    background: rgba(255, 255, 255, 0.82);
}

.alerts-filter-copy {
    margin-top: 0.45rem;
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.6;
}

.alerts-filter-copy-strong {
    color: #0f172a;
    font-weight: 700;
}

.performance-label {
    color: #94a3b8;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.section-kicker {
    color: #94a3b8;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

.section-title {
    margin-top: 0.25rem;
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 900;
    line-height: 1.1;
}

.metric-xl {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.7rem;
    font-weight: 900;
    line-height: 1;
}

.metric-lg {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.7rem;
    font-weight: 900;
    line-height: 1;
}

.metric-md {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.7rem;
    font-weight: 900;
    line-height: 1;
}

.metric-unit-sm {
    margin-left: 0.25rem;
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 700;
}

.metric-unit-xs {
    margin-left: 0.25rem;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 700;
}

.performance-meter {
    height: 0.7rem;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(226, 232, 240, 0.68);
}

.performance-meter-bar {
    height: 100%;
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

.dynamic-envelope-panel {
    background:
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.07), transparent 24%),
        radial-gradient(circle at top left, rgba(15, 23, 42, 0.025), transparent 26%),
        rgba(255, 255, 255, 0.88);
}

.dynamic-envelope-badge {
    min-width: 220px;
    padding: 0.55rem 0.8rem;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.82);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.92));
    box-shadow: 0 16px 30px -28px rgba(15, 23, 42, 0.28);
}

.dynamic-envelope-card {
    border: 1px solid rgba(226, 232, 240, 0.76);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.86));
    box-shadow: 0 18px 32px -30px rgba(15, 23, 42, 0.28);
}

.dynamic-envelope-card-charge {
    background: linear-gradient(180deg, rgba(236, 254, 255, 0.95), rgba(255, 255, 255, 0.88));
}

.dynamic-envelope-card-discharge {
    background: linear-gradient(180deg, rgba(241, 245, 249, 0.98), rgba(255, 255, 255, 0.9));
}

.dynamic-envelope-subcard {
    border: 1px solid rgba(226, 232, 240, 0.76);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.92), rgba(255, 255, 255, 0.9));
    box-shadow: 0 16px 30px -30px rgba(15, 23, 42, 0.22);
}

.dynamic-envelope-timeline-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    font-size: 0.84rem;
}

.dynamic-envelope-time {
    min-width: 3.5rem;
    color: #94a3b8;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.dynamic-envelope-event {
    color: #334155;
    font-weight: 700;
    text-align: right;
}

.balancing-delta-trigger {
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.balancing-delta-trigger:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px -24px rgba(15, 23, 42, 0.26);
}

.delta-tone-green {
    animation: deltaPulseGreen 2s ease-in-out infinite;
}

.delta-tone-yellow {
    animation: deltaPulseYellow 2s ease-in-out infinite;
}

.delta-tone-orange {
    animation: deltaPulseOrange 1.7s ease-in-out infinite;
}

.delta-tone-red {
    animation: deltaPulseRed 1.35s ease-in-out infinite;
}

.delta-tone-cyan {
    animation: deltaPulseCyan 2s ease-in-out infinite;
}

.delta-tone-blue {
    animation: deltaPulseBlue 1.7s ease-in-out infinite;
}

.delta-tone-indigo {
    animation: deltaPulseIndigo 1.35s ease-in-out infinite;
}

@keyframes deltaPulseGreen {
    0%, 100% {
        box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.08), 0 0 0 0 rgba(16, 185, 129, 0);
        background: rgba(236, 253, 245, 0.86);
    }
    50% {
        box-shadow: inset 0 0 0 1px rgba(5, 150, 105, 0.18), 0 0 0 6px rgba(16, 185, 129, 0.08);
        background: rgba(209, 250, 229, 0.96);
    }
}

@keyframes deltaPulseYellow {
    0%, 100% {
        box-shadow: inset 0 0 0 1px rgba(234, 179, 8, 0.08), 0 0 0 0 rgba(234, 179, 8, 0);
        background: rgba(254, 249, 195, 0.84);
    }
    50% {
        box-shadow: inset 0 0 0 1px rgba(202, 138, 4, 0.18), 0 0 0 6px rgba(234, 179, 8, 0.1);
        background: rgba(254, 240, 138, 0.96);
    }
}

@keyframes deltaPulseOrange {
    0%, 100% {
        box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.08), 0 0 0 0 rgba(249, 115, 22, 0);
        background: rgba(255, 237, 213, 0.84);
    }
    50% {
        box-shadow: inset 0 0 0 1px rgba(234, 88, 12, 0.18), 0 0 0 7px rgba(249, 115, 22, 0.12);
        background: rgba(253, 186, 116, 0.98);
    }
}

@keyframes deltaPulseRed {
    0%, 100% {
        box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.1), 0 0 0 0 rgba(239, 68, 68, 0);
        background: rgba(254, 226, 226, 0.86);
    }
    50% {
        box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.2), 0 0 0 8px rgba(239, 68, 68, 0.14);
        background: rgba(252, 165, 165, 0.98);
    }
}

@keyframes deltaPulseCyan {
    0%, 100% {
        box-shadow: inset 0 0 0 1px rgba(6, 182, 212, 0.08), 0 0 0 0 rgba(6, 182, 212, 0);
        background: rgba(207, 250, 254, 0.86);
    }
    50% {
        box-shadow: inset 0 0 0 1px rgba(8, 145, 178, 0.18), 0 0 0 6px rgba(6, 182, 212, 0.1);
        background: rgba(165, 243, 252, 0.98);
    }
}

@keyframes deltaPulseBlue {
    0%, 100% {
        box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08), 0 0 0 0 rgba(37, 99, 235, 0);
        background: rgba(219, 234, 254, 0.86);
    }
    50% {
        box-shadow: inset 0 0 0 1px rgba(29, 78, 216, 0.18), 0 0 0 7px rgba(37, 99, 235, 0.12);
        background: rgba(147, 197, 253, 0.98);
    }
}

@keyframes deltaPulseIndigo {
    0%, 100% {
        box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.1), 0 0 0 0 rgba(79, 70, 229, 0);
        background: rgba(224, 231, 255, 0.86);
    }
    50% {
        box-shadow: inset 0 0 0 1px rgba(67, 56, 202, 0.2), 0 0 0 8px rgba(79, 70, 229, 0.14);
        background: rgba(165, 180, 252, 0.98);
    }
}

.delta-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    opacity: 1;
    visibility: visible;
    transition: opacity 160ms ease, visibility 160ms ease;
}

.battery-offline-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
    transition: opacity 180ms ease, visibility 180ms ease;
}

.battery-offline-modal[aria-hidden="true"] {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.battery-offline-backdrop {
    position: absolute;
    inset: 0;
    background: #ffffff;
}

.battery-offline-panel {
    position: relative;
    pointer-events: auto;
    width: min(420px, calc(100vw - 2rem));
    border-radius: 1.25rem;
    border: 1px solid rgba(249, 115, 22, 0.22);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 247, 237, 0.96));
    box-shadow: 0 24px 64px -34px rgba(15, 23, 42, 0.45);
    padding: 1.2rem 1.25rem 1.1rem;
    text-align: center;
}

.battery-offline-kicker {
    color: #f97316;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

.battery-offline-title {
    margin-top: 0.45rem;
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.4rem;
    font-weight: 900;
    line-height: 1.1;
}

.battery-offline-copy {
    margin-top: 0.45rem;
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.5;
}

.firmware-update-modal {
    position: fixed;
    inset: 0;
    z-index: 71;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 1;
    visibility: visible;
    transition: opacity 180ms ease, visibility 180ms ease;
    padding: 1rem;
}

.firmware-update-modal[aria-hidden="true"] {
    opacity: 0;
    visibility: hidden;
}

.firmware-update-panel {
    position: relative;
    pointer-events: auto;
    width: min(680px, calc(100vw - 2rem));
    border-radius: 1.35rem;
    border: 1px solid rgba(245, 158, 11, 0.22);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 251, 235, 0.96));
    box-shadow: 0 28px 72px -36px rgba(15, 23, 42, 0.42);
    padding: 1.25rem;
}

.firmware-update-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.firmware-update-kicker {
    color: #d97706;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

.firmware-update-title {
    margin-top: 0.42rem;
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.55rem;
    font-weight: 900;
    line-height: 1.08;
}

.firmware-update-badge {
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(245, 158, 11, 0.18);
    background: rgba(255, 247, 237, 0.92);
    color: #b45309;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    white-space: nowrap;
}

.firmware-update-copy {
    margin-top: 0.7rem;
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.55;
}

.firmware-update-warning {
    margin-top: 0.9rem;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(251, 191, 36, 0.28);
    background: linear-gradient(180deg, rgba(255, 251, 235, 0.98), rgba(255, 247, 237, 0.92));
}

.firmware-update-warning-title {
    color: #b45309;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.firmware-update-warning-copy {
    margin-top: 0.42rem;
    color: #7c2d12;
    font-size: 0.88rem;
    line-height: 1.55;
}

.firmware-update-schedule {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 0.95rem;
}

.firmware-update-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.firmware-update-input {
    height: 2.8rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(226, 232, 240, 0.92);
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
    padding: 0 0.85rem;
    font-size: 0.92rem;
    font-weight: 600;
    outline: none;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.firmware-update-input:focus {
    border-color: rgba(245, 158, 11, 0.52);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.14);
}

.firmware-update-helper {
    min-height: 1.15rem;
    margin-top: 0.6rem;
    color: #b45309;
    font-size: 0.78rem;
    font-weight: 700;
}

.firmware-update-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.7rem;
    margin-top: 0.65rem;
}

.firmware-update-button {
    height: 2.8rem;
    padding: 0 1rem;
    border-radius: 0.95rem;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

.firmware-update-button:hover {
    transform: translateY(-1px);
}

.firmware-update-button-secondary {
    border: 1px solid rgba(226, 232, 240, 0.92);
    background: rgba(255, 255, 255, 0.94);
    color: #475569;
}

.firmware-update-button-primary {
    border: 1px solid rgba(16, 185, 129, 0.22);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.98), rgba(5, 150, 105, 0.95));
    color: #ffffff;
    box-shadow: 0 18px 36px -24px rgba(16, 185, 129, 0.42);
}

.firmware-update-panel-compact {
    width: min(520px, calc(100vw - 2rem));
}

.firmware-update-title-sm {
    font-size: 1.25rem;
}

.firmware-update-backdrop-light {
    background: rgba(15, 23, 42, 0.16);
}

.firmware-update-panel-success {
    border-color: rgba(16, 185, 129, 0.2);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(236, 253, 245, 0.95));
}

.critical-fault-panel {
    width: min(720px, calc(100vw - 2rem));
    border-color: rgba(239, 68, 68, 0.24);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.985), rgba(254, 242, 242, 0.97));
    box-shadow: 0 30px 74px -34px rgba(127, 29, 29, 0.34);
}

.critical-fault-kicker {
    color: #dc2626;
}

.critical-fault-badge {
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(239, 68, 68, 0.22);
    background: rgba(254, 242, 242, 0.92);
    color: #b91c1c;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.critical-fault-detail-shell {
    margin-top: 0.9rem;
    padding: 0.95rem 1rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(248, 113, 113, 0.2);
    background: rgba(255, 255, 255, 0.9);
}

.critical-fault-detail-title {
    margin-top: 0.45rem;
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.15;
}

.critical-fault-detail-copy {
    margin-top: 0.4rem;
    color: #475569;
    font-size: 0.92rem;
    line-height: 1.6;
}

.critical-fault-service-box {
    margin-top: 0.85rem;
    padding: 0.95rem 1rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.84);
    background: rgba(255, 255, 255, 0.82);
}

.critical-fault-service-title {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.1;
}

.critical-fault-service-copy {
    margin-top: 0.38rem;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.55;
}

.critical-fault-service-status {
    min-height: 1.15rem;
    margin-top: 0.7rem;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 700;
}

.critical-fault-service-status.is-success {
    color: #059669;
}

.critical-fault-service-status.is-error {
    color: #dc2626;
}

.critical-fault-service-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.firmware-update-kicker-success {
    color: #059669;
}

.firmware-installing-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin-top: 1rem;
}

.firmware-progress-meta { display:flex; align-items:baseline; justify-content:space-between; gap:1rem; margin-top:1.25rem; color:#64748b; font-size:.78rem; }
.firmware-progress-meta strong { color:#059669; font-size:1.15rem; }
.firmware-progress-track { height:.7rem; margin-top:.55rem; overflow:hidden; border-radius:999px; background:#e2e8f0; box-shadow:inset 0 1px 2px rgba(15,23,42,.12); }
.firmware-progress-track span { display:block; width:0; height:100%; border-radius:inherit; background:linear-gradient(90deg,#10b981,#22c55e,#84cc16); transition:width .45s ease; }

.firmware-installing-loader span {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.98), rgba(5, 150, 105, 0.95));
    animation: firmwareInstallingPulse 1s ease-in-out infinite;
}

.firmware-installing-loader span:nth-child(2) {
    animation-delay: 0.16s;
}

.firmware-installing-loader span:nth-child(3) {
    animation-delay: 0.32s;
}

@keyframes firmwareInstallingPulse {
    0%, 100% {
        opacity: 0.35;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-5px);
    }
}

.delta-modal[aria-hidden="true"] {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.delta-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.delta-modal-panel {
    position: relative;
    width: min(920px, 100%);
    border-radius: 1.5rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 28px 60px -40px rgba(15, 23, 42, 0.42);
    padding: 1rem;
}

.delta-modal-close {
    position: absolute;
    top: 0.85rem;
    right: 0.95rem;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 999px;
    background: rgba(241, 245, 249, 0.92);
    color: #334155;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.delta-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-right: 2rem;
}

.delta-modal-chart {
    margin-top: 0.9rem;
    min-height: 260px;
}

.energy-panel {
    background:
        radial-gradient(circle at top left, rgba(99, 102, 241, 0.06), transparent 23%),
        radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.05), transparent 24%),
        rgba(255, 255, 255, 0.88);
}

.energy-loss-badge {
    min-width: 0;
    border: 1px solid rgba(199, 210, 254, 0.8);
    background: linear-gradient(135deg, rgba(238, 242, 255, 0.96), rgba(255, 255, 255, 0.92));
    box-shadow: 0 16px 30px -28px rgba(79, 70, 229, 0.22);
}

.energy-card {
    border: 1px solid rgba(226, 232, 240, 0.76);
    box-shadow: 0 18px 32px -30px rgba(15, 23, 42, 0.24);
}

.energy-card-primary {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.88));
}

.energy-card-efficiency {
    background: linear-gradient(180deg, rgba(236, 253, 245, 0.96), rgba(255, 255, 255, 0.9));
}

.energy-card-throughput {
    background: linear-gradient(180deg, rgba(238, 242, 255, 0.96), rgba(255, 255, 255, 0.9));
}

.energy-single-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.75rem;
}

.energy-card-loss {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.94), rgba(255, 255, 255, 0.9));
}

.energy-card-loss-main {
    background: linear-gradient(180deg, rgba(255, 247, 237, 0.95), rgba(255, 255, 255, 0.9));
}

.energy-value {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1;
}

.energy-value-strong {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1;
}

.usage-profile-panel {
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.05), transparent 26%),
        radial-gradient(circle at bottom right, rgba(99, 102, 241, 0.045), transparent 24%),
        rgba(255, 255, 255, 0.88);
}

.usage-profile-band-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.usage-profile-band-trigger {
    padding: 0.65rem 0.72rem 0.72rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(226, 232, 240, 0.72);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9));
    box-shadow: 0 14px 28px -30px rgba(15, 23, 42, 0.18);
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.usage-profile-band-trigger:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 32px -28px rgba(15, 23, 42, 0.22);
}

.usage-profile-band {
    display: flex;
    width: 100%;
    height: 0.8rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.62);
    box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.62);
}

.usage-profile-segment {
    min-width: 0;
    height: 100%;
}

.usage-profile-trigger-copy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-top: 0.55rem;
}

.usage-profile-trigger-action {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
}

.usage-profile-legend {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.5rem;
}

.usage-profile-legend-item {
    padding: 0.45rem 0.55rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(226, 232, 240, 0.72);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9));
    box-shadow: 0 14px 28px -30px rgba(15, 23, 42, 0.18);
}

.usage-profile-legend-top {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.usage-profile-dot {
    width: 0.48rem;
    height: 0.48rem;
    border-radius: 999px;
    flex: 0 0 auto;
}

.usage-profile-compact {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.usage-profile-compact-row {
    padding: 0.5rem 0.72rem 0.56rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(226, 232, 240, 0.72);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9));
    box-shadow: 0 14px 28px -30px rgba(15, 23, 42, 0.18);
}

.usage-profile-compact-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.usage-profile-compact-metrics {
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.usage-profile-stack {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.usage-profile-row {
    padding: 0.62rem 0.8rem;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.76);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9));
    box-shadow: 0 16px 30px -30px rgba(15, 23, 42, 0.2);
}

.usage-profile-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 0.75rem;
}

.usage-profile-count,
.usage-profile-percent {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    line-height: 1;
}

.usage-profile-count {
    font-size: 1rem;
}

.usage-profile-percent {
    font-size: 1rem;
}

.usage-profile-unit {
    margin-left: 0.22rem;
    color: #94a3b8;
    font-size: 0.6rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
}

.usage-profile-meter {
    margin-top: 0.42rem;
    height: 0.42rem;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(226, 232, 240, 0.68);
}

.usage-profile-fill {
    height: 100%;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.usage-profile-modal-panel {
    width: min(640px, 100%);
}

.usage-profile-modal-body {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: min(72vh, 760px);
    overflow: auto;
}

.usage-profile-detail-row {
    padding: 0.72rem 0.8rem;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.76);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9));
    box-shadow: 0 16px 30px -30px rgba(15, 23, 42, 0.2);
}

.usage-profile-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.usage-profile-meter-detail {
    margin-top: 0.6rem;
    height: 0.5rem;
}

.usage-tone-shallow {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.95), rgba(14, 165, 233, 0.92));
}

.usage-tone-medium {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.94), rgba(79, 70, 229, 0.92));
}

.usage-tone-deep {
    background: linear-gradient(90deg, rgba(251, 146, 60, 0.96), rgba(234, 88, 12, 0.92));
}

.soc-exposure-panel {
    background:
        radial-gradient(circle at top right, rgba(251, 191, 36, 0.06), transparent 24%),
        radial-gradient(circle at bottom left, rgba(59, 130, 246, 0.045), transparent 24%),
        rgba(255, 255, 255, 0.88);
}

.soc-exposure-band-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.soc-exposure-band {
    display: flex;
    width: 100%;
    height: 0.75rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.62);
    box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.62);
}

.soc-exposure-segment {
    height: 100%;
    min-width: 0;
}

.soc-exposure-legend {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.soc-exposure-legend-item {
    padding: 0.5rem 0.62rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(226, 232, 240, 0.72);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9));
    box-shadow: 0 14px 28px -30px rgba(15, 23, 42, 0.18);
}

.soc-exposure-legend-top {
    display: flex;
    align-items: center;
    gap: 0.42rem;
}

.soc-exposure-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    flex: 0 0 auto;
}

.soc-exposure-stack {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.soc-exposure-row {
    padding: 0.62rem 0.8rem;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.76);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9));
    box-shadow: 0 16px 30px -30px rgba(15, 23, 42, 0.2);
}

.soc-exposure-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 0.75rem;
}

.soc-exposure-value {
    margin-top: 0.32rem;
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

.soc-exposure-meter {
    margin-top: 0.55rem;
    height: 0.56rem;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(226, 232, 240, 0.68);
}

.soc-exposure-fill {
    height: 100%;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.soc-exposure-high {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.96), rgba(245, 158, 11, 0.92));
}

.soc-exposure-low {
    background: linear-gradient(90deg, rgba(96, 165, 250, 0.96), rgba(37, 99, 235, 0.92));
}

.soc-exposure-normal {
    background: linear-gradient(90deg, rgba(52, 211, 153, 0.96), rgba(5, 150, 105, 0.92));
}

.calibration-panel {
    background:
        radial-gradient(circle at top left, rgba(99, 102, 241, 0.055), transparent 24%),
        radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.045), transparent 22%),
        rgba(255, 255, 255, 0.88);
}

.calibration-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.calibration-strip-card {
    padding: 0.55rem 0.72rem 0.62rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(226, 232, 240, 0.72);
    box-shadow: 0 14px 28px -30px rgba(15, 23, 42, 0.18);
}

.calibration-strip-card .metric-lg {
    font-size: 1.1rem;
}

.calibration-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
}

.calibration-card {
    border: 1px solid rgba(226, 232, 240, 0.76);
    box-shadow: 0 16px 30px -30px rgba(15, 23, 42, 0.22);
    min-height: 72px;
}

.calibration-card-balance {
    background: linear-gradient(180deg, rgba(238, 242, 255, 0.96), rgba(255, 255, 255, 0.9));
}

.calibration-card-drift {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.9));
}

.calibration-card-capacity {
    background: linear-gradient(180deg, rgba(236, 253, 245, 0.96), rgba(255, 255, 255, 0.9));
}

.diagnostics-hero-panel {
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.06), transparent 22%),
        radial-gradient(circle at bottom right, rgba(99, 102, 241, 0.05), transparent 24%),
        rgba(255, 255, 255, 0.88);
}

.diagnostics-panel {
    background:
        radial-gradient(circle at top right, rgba(15, 23, 42, 0.03), transparent 22%),
        rgba(255, 255, 255, 0.88);
}

.diagnostics-status-shell {
    min-width: 240px;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.82);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
    box-shadow: 0 18px 34px -32px rgba(15, 23, 42, 0.26);
}

.diagnostics-status-value {
    margin-top: 0.34rem;
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1;
}

.diagnostics-status-copy {
    margin-top: 0.38rem;
    color: #64748b;
    font-size: 0.84rem;
    line-height: 1.5;
}

.diagnostics-tone-emerald {
    background: linear-gradient(180deg, rgba(236, 253, 245, 0.95), rgba(255, 255, 255, 0.9));
}

.diagnostics-tone-rose {
    background: linear-gradient(180deg, rgba(254, 242, 242, 0.96), rgba(255, 255, 255, 0.92));
}

.diagnostics-tone-amber {
    background: linear-gradient(180deg, rgba(255, 251, 235, 0.96), rgba(255, 255, 255, 0.92));
}

.diagnostics-tone-cyan {
    background: linear-gradient(180deg, rgba(236, 254, 255, 0.95), rgba(255, 255, 255, 0.9));
}

.diagnostics-tone-indigo {
    background: linear-gradient(180deg, rgba(238, 242, 255, 0.96), rgba(255, 255, 255, 0.9));
}

.diagnostics-tone-slate {
    background: linear-gradient(180deg, rgba(241, 245, 249, 0.96), rgba(255, 255, 255, 0.92));
}

.diagnostics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.diagnostics-mini-card {
    padding: 0.72rem 0.8rem 0.78rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(226, 232, 240, 0.72);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(248, 250, 252, 0.92));
    box-shadow: 0 14px 28px -30px rgba(15, 23, 42, 0.18);
}

.diagnostics-mini-card-strong {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.94));
}

.diagnostics-mini-value {
    margin-top: 0.34rem;
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
}

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

.diagnostics-raw-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.58rem 0.7rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(226, 232, 240, 0.72);
    background: rgba(255, 255, 255, 0.82);
}

.diagnostics-raw-key {
    color: #94a3b8;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.diagnostics-raw-value {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    text-align: right;
}

.diagnostics-table-shell {
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.72);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.9), rgba(255, 255, 255, 0.96));
    overflow: hidden;
}

.diagnostics-table-head,
.diagnostics-table-row {
    display: grid;
    grid-template-columns: 58px 74px 74px 78px 72px 68px 116px 54px;
    gap: 0.45rem;
    align-items: center;
    padding: 0.62rem 0.75rem;
}

.diagnostics-table-head {
    border-bottom: 1px solid rgba(226, 232, 240, 0.72);
    color: #94a3b8;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.86);
}

.diagnostics-table-body {
    display: flex;
    flex-direction: column;
}

.diagnostics-table-row {
    color: #334155;
    font-size: 0.78rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(226, 232, 240, 0.58);
}

.diagnostics-table-row:last-child {
    border-bottom: none;
}

.diagnostics-module-label {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.84rem;
    font-weight: 800;
}

.diagnostics-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-width: 66px;
    padding: 0.28rem 0.45rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.diagnostics-pill-online {
    color: #059669;
    background: rgba(236, 253, 245, 0.96);
}

.diagnostics-pill-warning {
    color: #b45309;
    background: rgba(255, 251, 235, 0.96);
}

.diagnostics-pill-offline {
    color: #475569;
    background: rgba(241, 245, 249, 0.96);
}

.diagnostics-pill-faulty {
    color: #dc2626;
    background: rgba(254, 242, 242, 0.98);
}

@media (min-width: 640px) and (max-width: 1279px) {
    .calibration-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .calibration-card-capacity {
        grid-column: span 2;
    }
}

@media (max-width: 767px) {
    body {
        padding: 0.65rem;
        gap: 0.65rem;
    }

    .topbar-shell {
        padding: 0.8rem;
    }

    .topbar-layout {
        gap: 0.8rem;
        min-height: 0;
    }

    .topbar-brand-group {
        padding-left: 0;
        align-items: flex-start;
        gap: 0.65rem;
    }

    .topbar-brand {
        width: auto;
        max-width: 100%;
    }

    .topbar-nav {
        width: 100%;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: stretch;
        align-items: stretch;
        gap: 0.45rem;
        flex-wrap: nowrap;
        overflow: visible;
        scrollbar-width: none;
        padding: 0;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .topbar-nav::-webkit-scrollbar {
        display: none;
    }

    .topbar-link {
        flex: 0 1 auto;
        width: 100%;
        justify-content: center;
        min-height: 2.8rem;
        padding: 0.65rem 0.5rem !important;
        font-size: 0.68rem !important;
        border-radius: 1rem !important;
        border: 1px solid rgba(226, 232, 240, 0.82);
        background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.94));
        box-shadow: 0 14px 26px -24px rgba(15, 23, 42, 0.22);
        color: #475569 !important;
        letter-spacing: 0.01em;
        gap: 0.38rem !important;
    }

    .topbar-link > span:last-child {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .reserve-mains-badge-inline {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
    }

    .topbar-link-active {
        background: linear-gradient(135deg, rgba(238, 242, 255, 0.98), rgba(255, 255, 255, 0.96)) !important;
        border-color: rgba(129, 140, 248, 0.38) !important;
        color: #4338ca !important;
        box-shadow: 0 16px 34px -24px rgba(79, 70, 229, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.72);
    }

    .topbar-link-active > span:first-child {
        box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
    }

    .topbar-link-alert-warning {
        border-color: rgba(249, 115, 22, 0.28) !important;
    }

    .topbar-link-alert-critical {
        border-color: rgba(239, 68, 68, 0.28) !important;
    }

    #liveDashboardHeader {
        display: none !important;
    }

    #liveDashboardHeaderMobile {
        display: block !important;
    }

    .energy-single-row {
        grid-template-columns: 1fr;
    }

    .alerts-filter-grid,
    .diagnostics-grid,
    .diagnostics-raw-grid,
    .usage-profile-legend,
    .soc-exposure-legend,
    .calibration-strip {
        grid-template-columns: 1fr;
    }

    .firmware-update-schedule {
        grid-template-columns: 1fr;
    }

    .firmware-update-actions {
        flex-direction: column;
    }

    .diagnostics-table-shell {
        overflow-x: auto;
    }

    .diagnostics-table-head,
    .diagnostics-table-row {
        min-width: 730px;
    }

    #liveDashboardStatusStrip .grid {
        min-width: 0;
    }

    #liveDashboardTrend .static.md\\:absolute {
        position: static !important;
        margin-bottom: 0.25rem;
    }

    #liveDashboardTrend .shrink-0.mt-3.grid {
        grid-template-columns: 1fr 1fr;
    }

    #liveDashboardTemperature .glass-panel {
        padding: 0.8rem;
    }

    #liveDashboardTemperature .relative.xl\\:absolute {
        width: 100%;
    }

    .alerts-item-top,
    .alerts-item-heading,
    .fleet-section-head,
    .fleet-account-head,
    .settings-reserve-head,
    .settings-limit-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .settings-io-dashboard {
        grid-template-columns: 1fr;
    }

    .settings-io-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

@media (min-width: 768px) and (max-width: 1279px) {
    .usage-profile-legend {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 768px) and (max-width: 1279px) {
    .energy-single-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) and (max-width: 1535px) {
    .energy-single-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1536px) {
    .energy-single-row {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.balancing-matrix-shell {
    border: 1px solid rgba(226, 232, 240, 0.72);
    border-radius: 1.25rem;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.86), rgba(255, 255, 255, 0.94));
    overflow: hidden;
}

.balancing-matrix-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding: 0.9rem 1rem 0.75rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    background: rgba(255, 255, 255, 0.76);
}

.balancing-legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 700;
}

.balancing-legend-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.balancing-legend-balancing {
    background: #ffffff;
    box-shadow: inset 0 0 0 2px #4f46e5;
}

.balancing-matrix-scroll {
    overflow: auto;
}

.balancing-matrix-grid {
    min-width: 1100px;
}

.balancing-matrix-header,
.balancing-module-row {
    display: grid;
    grid-template-columns: 58px 62px 52px 40px 54px 54px 54px repeat(16, minmax(31px, 1fr));
    gap: 0.2rem;
    padding: 0.4rem 0.5rem;
    align-items: center;
}

.balancing-cell-empty {
    min-width: 0;
    min-height: 1.6rem;
    visibility: hidden;
}

.balancing-matrix-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(248, 250, 252, 0.98);
    border-bottom: 1px solid rgba(226, 232, 240, 0.72);
}

.balancing-module-row {
    border-bottom: 1px solid rgba(226, 232, 240, 0.58);
}

.balancing-module-row:last-child {
    border-bottom: none;
}

.balancing-module-row-faulty {
    background: rgba(254, 226, 226, 0.5);
    animation: balancingFaultPulse 1.8s ease-in-out infinite;
}

@keyframes balancingFaultPulse {
    0%,
    100% {
        background: rgba(254, 226, 226, 0.42);
        box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.08);
    }
    50% {
        background: rgba(254, 202, 202, 0.88);
        box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.22);
    }
}

.balancing-meta-head,
.balancing-slot-head {
    color: #94a3b8;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-align: center;
}

.balancing-meta {
    color: #475569;
    font-size: 0.66rem;
    font-weight: 700;
    white-space: nowrap;
}

.balancing-meta strong {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.82rem;
}

.balancing-cell {
    min-height: 1.68rem;
    border-radius: 0.46rem;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.balancing-cell:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 20px -18px rgba(15, 23, 42, 0.55);
}

.balancing-cell-voltage,
.balancing-cell-empty-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.67rem;
    font-weight: 700;
    line-height: 1;
}

.balancing-cell-empty-label {
    color: #cbd5e1;
}

.balancing-cell-nominal {
    background: rgba(187, 247, 208, 0.98);
    border-color: rgba(5, 150, 105, 0.28);
}

.balancing-cell-attention-high {
    background: rgba(254, 240, 138, 0.98);
    border-color: rgba(202, 138, 4, 0.28);
}

.balancing-cell-warning-high {
    background: rgba(253, 186, 116, 0.98);
    border-color: rgba(234, 88, 12, 0.28);
}

.balancing-cell-critical-high {
    background: rgba(252, 165, 165, 0.98);
    border-color: rgba(220, 38, 38, 0.3);
}

.balancing-cell-attention-low {
    background: rgba(165, 243, 252, 0.98);
    border-color: rgba(8, 145, 178, 0.28);
}

.balancing-cell-warning-low {
    background: rgba(147, 197, 253, 0.98);
    border-color: rgba(29, 78, 216, 0.3);
}

.balancing-cell-critical-low {
    background: rgba(165, 180, 252, 0.98);
    border-color: rgba(79, 70, 229, 0.32);
}

.balancing-cell-empty {
    background: rgba(241, 245, 249, 0.95);
    border-color: rgba(203, 213, 225, 0.86);
}

.balancing-cell-active {
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.balancing-expandable-collapsed {
    display: none;
}

.balancing-card-toggle {
    cursor: pointer;
    transition: box-shadow 140ms ease, transform 140ms ease;
}

.balancing-card-toggle:hover {
    box-shadow: 0 12px 28px -24px rgba(15, 23, 42, 0.2);
}

::-webkit-scrollbar { width: 0; height: 0; }

.fleet-shell {
    background:
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.045), transparent 22%),
        rgba(255, 255, 255, 0.88);
}

.fleet-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(320px, 520px);
    gap: 0.65rem;
    align-items: center;
}

.fleet-title {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.92rem;
    font-weight: 900;
    letter-spacing: 0.01em;
    line-height: 1;
}

.fleet-subtitle {
    margin-top: 0.18rem;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.45;
}

.fleet-list-title {
    margin-top: 0.2rem;
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.01em;
    line-height: 1.1;
}

.fleet-summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.58rem;
    padding: 0.46rem 0.68rem;
    border-radius: 0.82rem;
    border: 1px solid rgba(226, 232, 240, 0.82);
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.88));
    justify-self: center;
}

.fleet-summary-chip-label {
    color: #94a3b8;
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.fleet-summary-chip-value {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.96rem;
    font-weight: 900;
    line-height: 1;
}

.fleet-claim-form {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.55rem;
    width: 100%;
    max-width: 470px;
    justify-self: end;
}

.fleet-claim-field {
    display: flex;
    flex-direction: column;
    gap: 0.24rem;
    min-width: 0;
    flex: 1 1 280px;
}

.fleet-claim-input {
    width: 100%;
    height: 2.3rem;
    border-radius: 0.82rem;
    border: 1px solid rgba(203, 213, 225, 0.92);
    background: rgba(255, 255, 255, 0.94);
    padding: 0 0.78rem;
    color: #0f172a;
    font-size: 0.78rem;
    font-weight: 700;
    outline: none;
}

.fleet-claim-button {
    height: 2.3rem;
    padding: 0 0.82rem;
    border-radius: 0.82rem;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: 0 18px 30px -24px rgba(15, 23, 42, 0.55);
}

.fleet-claim-feedback {
    margin-top: 0.65rem;
    padding: 0.62rem 0.78rem;
    border-radius: 0.82rem;
    font-size: 0.74rem;
    font-weight: 700;
}

.fleet-claim-feedback-success {
    color: #065f46;
    background: rgba(236, 253, 245, 0.92);
    border: 1px solid rgba(52, 211, 153, 0.24);
}

.fleet-claim-feedback-error {
    color: #991b1b;
    background: rgba(254, 242, 242, 0.94);
    border: 1px solid rgba(248, 113, 113, 0.24);
}

.fleet-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
    gap: 0.62rem;
}

.fleet-device-card {
    display: flex;
    flex-direction: column;
    gap: 0.46rem;
    padding: 0.68rem 0.74rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(226, 232, 240, 0.84);
    background:
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.05), transparent 24%),
        linear-gradient(180deg, rgba(255,255,255,0.97), rgba(248,250,252,0.9));
    box-shadow: 0 18px 32px -30px rgba(15, 23, 42, 0.28);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.fleet-device-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.18);
    box-shadow: 0 22px 36px -28px rgba(15, 23, 42, 0.3);
}

.fleet-device-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.fleet-device-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.24rem 0.46rem;
    border-radius: 999px;
    color: #4f46e5;
    background: rgba(238, 242, 255, 0.96);
    font-size: 0.54rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.fleet-device-pill-ok {
    color: #047857;
    background: rgba(209, 250, 229, 0.96);
}

.fleet-device-pill-offline {
    color: #475569;
    background: rgba(241, 245, 249, 0.96);
}

.fleet-device-pill-fault {
    color: #b91c1c;
    background: rgba(254, 226, 226, 0.96);
}

.fleet-device-pill-unknown {
    color: #64748b;
    background: rgba(248, 250, 252, 0.96);
}

.fleet-device-open {
    color: #64748b;
    font-size: 0.62rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 122px;
    text-align: right;
    white-space: nowrap;
}

.fleet-device-name-row {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 0.6rem;
}

.fleet-friendly-editor {
    flex: 0 0 auto;
}

.fleet-friendly-editor summary {
    list-style: none;
}

.fleet-friendly-editor summary::-webkit-details-marker {
    display: none;
}

.fleet-friendly-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 1.75rem;
    padding: 0 0.62rem;
    border-radius: 0.72rem;
    border: 1px solid rgba(203, 213, 225, 0.9);
    background: rgba(255, 255, 255, 0.92);
    color: #475569;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
}

.fleet-friendly-editor[open] .fleet-friendly-trigger {
    color: #0f172a;
    border-color: rgba(99, 102, 241, 0.24);
    background: rgba(238, 242, 255, 0.92);
}

.fleet-friendly-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.45rem;
    align-items: end;
    margin-top: 0.45rem;
    min-width: 220px;
}

.fleet-friendly-label {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    min-width: 0;
}

.fleet-friendly-input {
    width: 100%;
    height: 2rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(203, 213, 225, 0.9);
    background: rgba(255, 255, 255, 0.92);
    padding: 0 0.68rem;
    color: #0f172a;
    font-size: 0.72rem;
    font-weight: 700;
    outline: none;
}

.fleet-friendly-save {
    height: 2rem;
    padding: 0 0.7rem;
    border-radius: 0.75rem;
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.fleet-device-serial {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.84rem;
    font-weight: 900;
    line-height: 1.15;
}

.fleet-device-meta {
    display: flex;
    flex-direction: column;
    gap: 0.14rem;
    color: #64748b;
    font-size: 0.66rem;
    font-weight: 600;
}

.fleet-device-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.42rem;
}

.fleet-stat-chip {
    display: flex;
    flex-direction: column;
    gap: 0.16rem;
    padding: 0.48rem 0.56rem;
    border-radius: 0.78rem;
    border: 1px solid rgba(226, 232, 240, 0.76);
    background: rgba(248, 250, 252, 0.82);
}

.fleet-stat-label {
    color: #94a3b8;
    font-size: 0.54rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.fleet-stat-value {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.1;
}

.fleet-empty-state {
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 1.2rem;
    border: 1px dashed rgba(203, 213, 225, 0.9);
    background: rgba(248, 250, 252, 0.72);
    padding: 0.86rem;
}

.fleet-empty-title {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
    font-weight: 900;
}

.fleet-empty-copy {
    color: #64748b;
    font-size: 0.74rem;
    line-height: 1.5;
    max-width: 520px;
    margin-top: 0.35rem;
}

@media (max-width: 1279px) {
    .fleet-toolbar {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .fleet-summary-chip,
    .fleet-claim-form {
        justify-self: stretch;
    }
}

.auth-stage {
    position: relative;
    isolation: isolate;
    padding: 1.5rem 0.8rem;
}

.auth-stage-glow {
    position: absolute;
    border-radius: 999px;
    filter: blur(56px);
    opacity: 0.75;
    pointer-events: none;
    z-index: -1;
}

.auth-stage-glow-a {
    width: 240px;
    height: 240px;
    top: calc(50% - 180px);
    left: calc(50% - 320px);
    background: rgba(99, 102, 241, 0.13);
}

.auth-stage-glow-b {
    width: 220px;
    height: 220px;
    top: calc(50% + 10px);
    left: calc(50% + 80px);
    background: rgba(16, 185, 129, 0.11);
}

.auth-simple-shell {
    max-width: 430px;
    position: relative;
    overflow: hidden;
    padding: 1.3rem;
}

.auth-premium-shell {
    background:
        radial-gradient(circle at top left, rgba(99, 102, 241, 0.11), transparent 26%),
        radial-gradient(circle at bottom right, rgba(6, 182, 212, 0.08), transparent 28%),
        linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.92));
    border: 1px solid rgba(226, 232, 240, 0.84);
    box-shadow:
        0 34px 80px -42px rgba(15, 23, 42, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(18px);
}

.auth-premium-orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(10px);
    pointer-events: none;
}

.auth-premium-orb-a {
    width: 92px;
    height: 92px;
    top: -24px;
    right: -18px;
    background: rgba(99, 102, 241, 0.12);
}

.auth-premium-orb-b {
    width: 72px;
    height: 72px;
    bottom: -18px;
    left: -10px;
    background: rgba(6, 182, 212, 0.1);
}

.auth-simple-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.72rem;
    text-align: center;
    margin-bottom: 1.05rem;
    position: relative;
    z-index: 1;
}

.auth-premium-brand {
    margin-bottom: 0.9rem;
}

.auth-kicker {
    margin-top: -0.1rem;
}

.auth-brand-mark {
    box-shadow: 0 18px 30px -24px rgba(99, 102, 241, 0.38);
}

.auth-simple-title {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.42rem;
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.auth-simple-subtitle {
    margin-top: 0.28rem;
    color: #64748b;
    font-size: 0.8rem;
    line-height: 1.55;
    max-width: 18rem;
}

.auth-mode-switch {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
    padding: 0.32rem;
    margin-bottom: 1rem;
    border-radius: 1.05rem;
    background: rgba(248, 250, 252, 0.76);
    border: 1px solid rgba(226, 232, 240, 0.82);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.auth-mode-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.2rem;
    border-radius: 0.82rem;
    color: #64748b;
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.auth-mode-link-active {
    color: #4f46e5;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(238,242,255,0.94));
    box-shadow: 0 12px 24px -22px rgba(79, 70, 229, 0.42);
}

.auth-simple-form {
    display: grid;
    gap: 0.68rem;
    position: relative;
    z-index: 1;
}

.auth-field {
    display: grid;
    gap: 0.32rem;
}

.auth-inline-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem;
    align-items: center;
}

.auth-field-label {
    color: #94a3b8;
    font-size: 0.63rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding-left: 0.15rem;
}

.auth-input {
    width: 100%;
    height: 3rem;
    border-radius: 1rem;
    border: 1px solid rgba(203, 213, 225, 0.82);
    background: rgba(255, 255, 255, 0.98);
    padding: 0 0.96rem;
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 700;
    outline: none;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.78),
        0 10px 20px -18px rgba(15, 23, 42, 0.25);
    transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.auth-input:focus {
    border-color: rgba(99, 102, 241, 0.34);
    box-shadow:
        0 0 0 4px rgba(99, 102, 241, 0.08),
        0 16px 30px -24px rgba(79, 70, 229, 0.34);
    transform: translateY(-1px);
}

.auth-button {
    height: 3.02rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, #111827, #312e81);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    box-shadow:
        0 22px 36px -24px rgba(49, 46, 129, 0.58),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.auth-button-secondary {
    background: linear-gradient(135deg, #0f766e, #0891b2);
}

.auth-button-tertiary {
    background: linear-gradient(135deg, #4f46e5, #1d4ed8);
}

.auth-inline-button {
    min-width: 6.5rem;
    height: 3rem;
    padding: 0 1rem;
    white-space: nowrap;
}

.auth-prefill-card {
    display: grid;
    gap: 0.7rem;
    padding: 0.9rem 0.95rem;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.82);
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.92));
    box-shadow: 0 12px 28px -24px rgba(15, 23, 42, 0.22);
}

.auth-prefill-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.auth-prefill-row strong {
    display: block;
    margin-top: 0.28rem;
    color: #0f172a;
    font-size: 0.82rem;
    line-height: 1.45;
    word-break: break-word;
}

.auth-success-modal-kicker-warn {
    color: #ea580c;
}

.auth-modal-button {
    margin-top: 0.9rem;
    width: 100%;
}

.auth-simple-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1rem;
    position: relative;
    z-index: 1;
}

.auth-simple-links-center {
    flex-direction: column;
    justify-content: center;
}

.auth-simple-link {
    color: #4f46e5;
    font-size: 0.76rem;
    font-weight: 700;
}

.auth-simple-link-muted {
    color: #64748b;
}

.auth-status {
    margin-top: 0.9rem;
    padding: 0.78rem 0.9rem;
    border-radius: 1rem;
    font-size: 0.76rem;
    font-weight: 700;
    color: #0f172a;
    background: rgba(248, 250, 252, 0.86);
    border: 1px solid rgba(226, 232, 240, 0.72);
    position: relative;
    z-index: 1;
}

.auth-status-warn {
    color: #9a3412;
    background: rgba(255, 247, 237, 0.94);
    border-color: rgba(251, 146, 60, 0.22);
}

.auth-success-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.auth-success-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.36);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.auth-success-modal-panel {
    position: relative;
    width: min(100%, 420px);
    padding: 1.3rem 1.2rem 1.2rem;
    border-radius: 1.35rem;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background:
        radial-gradient(circle at top left, rgba(16, 185, 129, 0.12), transparent 28%),
        radial-gradient(circle at bottom right, rgba(99, 102, 241, 0.1), transparent 24%),
        linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.95));
    box-shadow:
        0 40px 90px -46px rgba(15, 23, 42, 0.46),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);
    text-align: center;
}

.auth-success-modal-panel-warn {
    border: 1px solid rgba(248, 113, 113, 0.24);
    background:
        radial-gradient(circle at top left, rgba(248, 113, 113, 0.12), transparent 30%),
        radial-gradient(circle at bottom right, rgba(249, 115, 22, 0.1), transparent 24%),
        linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,247,237,0.96));
}

.auth-success-modal-kicker {
    margin: 0;
    color: #10b981;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.auth-success-modal-title {
    margin: 0.45rem 0 0;
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.auth-success-modal-copy {
    margin: 0.6rem 0 0;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.6;
}

.auth-footnote {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 0.95rem;
    border-top: 1px solid rgba(226, 232, 240, 0.65);
    color: #94a3b8;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

.auth-footnote span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.auth-footnote span::before {
    content: '';
    width: 0.28rem;
    height: 0.28rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #6366f1, #10b981);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

@media (max-width: 640px) {
    .auth-inline-field,
    .auth-prefill-row {
        grid-template-columns: 1fr;
    }

    .performance-card,
    .performance-card-compact,
    .settings-summary-card,
    .settings-group-card,
    .settings-channel-card {
        border-radius: 0.95rem;
    }

    .performance-hero-value {
        font-size: 1.02rem;
    }

    .performance-hero-unit {
        font-size: 0.62rem;
    }

    .section-title {
        font-size: 1.18rem;
        line-height: 1.08;
    }

    .metric-xl {
        font-size: 1.65rem;
    }

    .metric-lg {
        font-size: 1.28rem;
    }

    .metric-md {
        font-size: 0.98rem;
    }

    .auth-stage {
        padding: 0.8rem 0;
    }

    .auth-stage-glow-a {
        left: calc(50% - 170px);
    }

    .auth-stage-glow-b {
        left: calc(50% - 20px);
        top: calc(50% + 70px);
    }

    .auth-simple-shell {
        padding: 1rem;
    }

    .auth-mode-link {
        min-height: 2.05rem;
        font-size: 0.62rem;
    }

    .auth-footnote {
        gap: 0.5rem;
        font-size: 0.58rem;
    }
}

.factory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.7rem;
}

.factory-card,
.factory-device-row {
    padding: 0.8rem 0.9rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(226, 232, 240, 0.76);
    background: rgba(248, 250, 252, 0.82);
}

.factory-actions,
.factory-assignments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.65rem;
}

.factory-device-list {
    display: grid;
    gap: 0.6rem;
}

.fleet-shell-premium {
    border: 1px solid rgba(226, 232, 240, 0.84);
    box-shadow: 0 30px 60px -42px rgba(15, 23, 42, 0.22);
    background:
        radial-gradient(circle at top left, rgba(99, 102, 241, 0.06), transparent 20%),
        radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.05), transparent 22%),
        rgba(255, 255, 255, 0.88);
}

.fleet-landing-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.9fr);
    gap: 1rem;
    align-items: stretch;
}

.fleet-hero-panel,
.fleet-account-card {
    min-width: 0;
    border-radius: 1.35rem;
    border: 1px solid rgba(226, 232, 240, 0.78);
    background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(248,250,252,0.9));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.fleet-hero-panel {
    padding: 1rem;
}

.fleet-account-card {
    padding: 0.95rem;
}

.fleet-toolbar-copy {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fleet-hero-copy {
    margin-top: 1rem;
}

.fleet-hero-heading {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.45rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    line-height: 1.02;
    max-width: 18ch;
}

.fleet-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 1rem;
}

.fleet-hero-stat {
    display: grid;
    gap: 0.32rem;
    padding: 0.82rem 0.88rem;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.78);
    background: rgba(248, 250, 252, 0.82);
}

.fleet-hero-stat-label {
    color: #94a3b8;
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.fleet-hero-stat-value {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
}

.fleet-claim-form-premium {
    margin-top: 1rem;
    padding: 0.78rem;
    border-radius: 1.05rem;
    border: 1px solid rgba(226, 232, 240, 0.78);
    background: rgba(255, 255, 255, 0.72);
    max-width: 100%;
}

.fleet-account-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 0.8rem;
}

.fleet-account-title {
    margin-top: 0.18rem;
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1.05;
}

.fleet-account-completion {
    display: grid;
    gap: 0.22rem;
    min-width: 84px;
    padding: 0.55rem 0.7rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(226, 232, 240, 0.84);
    text-align: right;
}

.fleet-account-completion-label {
    font-size: 0.52rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.fleet-account-completion strong {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
}

.fleet-profile-tier-basic {
    color: #475569;
    background: rgba(248, 250, 252, 0.9);
}

.fleet-profile-tier-partial {
    color: #92400e;
    background: rgba(255, 247, 237, 0.92);
}

.fleet-profile-tier-complete {
    color: #065f46;
    background: rgba(236, 253, 245, 0.92);
}

.fleet-account-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.32rem 0.7rem;
    margin-top: 0.65rem;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 600;
}

.fleet-account-form {
    margin-top: 0.8rem;
}

.fleet-account-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
    margin-bottom: 0.75rem;
}

.fleet-account-meta-chip {
    display: grid;
    gap: 0.18rem;
    padding: 0.72rem 0.8rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(226, 232, 240, 0.82);
    background: rgba(248, 250, 252, 0.84);
}

.fleet-account-meta-label {
    color: #94a3b8;
    font-size: 0.54rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.fleet-account-meta-chip strong {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1.1;
}

.fleet-account-sections {
    display: grid;
    gap: 0.7rem;
}

.fleet-account-type-toggle {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.3rem;
    padding: 0.3rem;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.82);
    background: rgba(248, 250, 252, 0.8);
    margin-bottom: 0.75rem;
    max-width: 340px;
}

.fleet-account-type-option {
    min-height: 2.1rem;
    padding: 0 0.8rem;
    border-radius: 0.82rem;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.fleet-account-type-option-active {
    color: #4338ca;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(238,242,255,0.94));
    box-shadow: 0 12px 24px -22px rgba(79, 70, 229, 0.42);
}

.fleet-account-cardlet {
    padding: 0.8rem;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.78);
    background: rgba(248, 250, 252, 0.72);
}

.fleet-account-cardlet-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.6rem;
}

.fleet-account-cardlet-title {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.1;
}

.fleet-account-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.62rem;
}

.fleet-account-grid-compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.52rem;
}

.fleet-account-field {
    display: grid;
    gap: 0.24rem;
}

.fleet-account-field-full {
    grid-column: 1 / -1;
}

.fleet-account-input {
    width: 100%;
    height: 2.45rem;
    border-radius: 0.88rem;
    border: 1px solid rgba(203, 213, 225, 0.9);
    background: rgba(255, 255, 255, 0.94);
    padding: 0 0.82rem;
    color: #0f172a;
    font-size: 0.77rem;
    font-weight: 700;
    outline: none;
}

.fleet-account-input-compact {
    height: 2.18rem;
    border-radius: 0.8rem;
    padding: 0 0.72rem;
    font-size: 0.73rem;
}

.fleet-account-select {
    appearance: none;
}

.fleet-account-textarea {
    width: 100%;
    min-height: 5.5rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(203, 213, 225, 0.9);
    background: rgba(255, 255, 255, 0.94);
    padding: 0.72rem 0.8rem;
    color: #0f172a;
    font-size: 0.74rem;
    font-weight: 600;
    outline: none;
    resize: vertical;
}

.fleet-account-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.82rem;
    padding-top: 0.82rem;
    border-top: 1px solid rgba(226, 232, 240, 0.74);
}

.fleet-account-progress-copy {
    color: #94a3b8;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.fleet-account-save {
    height: 2.4rem;
    padding: 0 0.96rem;
    border-radius: 0.88rem;
    background: linear-gradient(135deg, #0f766e, #0891b2);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    box-shadow: 0 18px 30px -24px rgba(8, 145, 178, 0.48);
}

@media (max-width: 1279px) {
    .fleet-landing-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .fleet-hero-heading {
        font-size: 1.18rem;
        max-width: none;
    }

    .fleet-hero-stats,
    .fleet-account-grid {
        grid-template-columns: 1fr;
    }

    .fleet-account-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .fleet-account-save {
        width: 100%;
    }
}

.fleet-page-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.fleet-page-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.fleet-page-tabs {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.82);
    background: rgba(248, 250, 252, 0.76);
}

.fleet-page-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    height: 2.3rem;
    padding: 0 0.9rem;
    border-radius: 0.82rem;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.fleet-page-tab-active {
    color: #4f46e5;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(238,242,255,0.94));
    box-shadow: 0 12px 24px -22px rgba(79, 70, 229, 0.42);
}

.fleet-page-tab-logout {
    color: #991b1b;
}

.fleet-home-hero,
.fleet-account-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
    gap: 1rem;
    align-items: stretch;
}

.fleet-account-overview {
    min-width: 0;
    border-radius: 1.35rem;
    border: 1px solid rgba(226, 232, 240, 0.78);
    background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(248,250,252,0.9));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
    padding: 0.95rem;
}

.fleet-transfer-note {
    margin-top: 0.9rem;
    padding: 0.85rem 0.9rem;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    background: rgba(248, 250, 252, 0.86);
}

.fleet-transfer-note-kicker {
    display: inline-flex;
    align-items: center;
    color: #4f46e5;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.fleet-transfer-note-copy {
    margin-top: 0.35rem;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.55;
}

@media (max-width: 1279px) {
    .fleet-home-hero,
    .fleet-account-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .fleet-page-tabs {
        width: 100%;
        justify-content: space-between;
    }

    .fleet-page-tab {
        min-width: 0;
        flex: 1 1 0;
    }
}

.fleet-portal-shell {
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
}

.fleet-page-caption {
    margin-top: 0.15rem;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 600;
}

.fleet-clean-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
}

.fleet-compact-panel {
    border: 1px solid rgba(226, 232, 240, 0.78);
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.9));
    box-shadow: 0 22px 50px -40px rgba(15, 23, 42, 0.18);
}

.fleet-compact-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.fleet-inline-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.fleet-inline-stat {
    display: inline-flex;
    align-items: center;
    min-height: 1.95rem;
    padding: 0 0.72rem;
    border-radius: 999px;
    border: 1px solid rgba(226, 232, 240, 0.84);
    background: rgba(248, 250, 252, 0.86);
    color: #475569;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.fleet-toolbar-form {
    display: flex;
    align-items: end;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.fleet-list-stack {
    display: grid;
    gap: 0.55rem;
}

.fleet-device-row {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) auto auto;
    gap: 0.9rem;
    align-items: center;
    padding: 0.75rem 0.85rem;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.78);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 18px 38px -34px rgba(15, 23, 42, 0.14);
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.fleet-device-row:hover {
    transform: translateY(-1px);
    border-color: rgba(99, 102, 241, 0.16);
    box-shadow: 0 24px 44px -34px rgba(15, 23, 42, 0.18);
}

.fleet-device-row-clickable {
    cursor: pointer;
}

.fleet-device-row-clickable:focus-visible {
    outline: 2px solid rgba(99, 102, 241, 0.42);
    outline-offset: 2px;
}

.fleet-device-row-main {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
}

.fleet-device-row-copy {
    display: grid;
    gap: 0.14rem;
    min-width: 0;
}

.fleet-device-row-title {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.88rem;
    font-weight: 900;
    line-height: 1.05;
}

.fleet-device-row-subtitle {
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2;
}

.fleet-device-row-metrics {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    justify-content: flex-start;
}

.fleet-device-row-metric {
    display: grid;
    gap: 0.1rem;
    min-width: 128px;
}

.fleet-device-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    min-width: 140px;
}

.fleet-device-open-passive {
    cursor: inherit;
}

.fleet-documents-modal[aria-hidden="true"] {
    display: none;
}

.fleet-documents-modal-panel {
    width: min(50vw, 720px);
    max-width: calc(100vw - 2rem);
    padding: 1.35rem 1.25rem 1.2rem;
    text-align: left;
}

.fleet-documents-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 1rem;
}

.fleet-doc-card {
    display: grid;
    gap: 0.35rem;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.fleet-doc-card-link:hover {
    transform: translateY(-1px);
    border-color: rgba(99, 102, 241, 0.22);
    box-shadow: 0 20px 38px -30px rgba(15, 23, 42, 0.22);
}

.fleet-doc-card-kicker {
    color: #94a3b8;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.fleet-doc-card-title {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.05;
}

.fleet-doc-card-note {
    color: #64748b;
    font-size: 0.75rem;
    line-height: 1.45;
}

.fleet-doc-card-disabled {
    opacity: 0.62;
    pointer-events: none;
}

.fleet-documents-copy-sep {
    display: inline-block;
    margin: 0 0.35rem;
}

.fleet-section-copy {
    margin: 0.25rem 0 0;
    color: #64748b;
    font-size: 0.76rem;
}

.fleet-document-register {
    display: grid;
    gap: 0.9rem;
    margin-top: 1rem;
}

.fleet-document-system {
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.86);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.8);
}

.fleet-document-system-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
}

.fleet-document-system-title {
    display: block;
    margin-top: 0.18rem;
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
}

.fleet-document-count {
    color: #059669;
    font-size: 0.68rem;
    font-weight: 800;
    white-space: nowrap;
}

.fleet-document-register-head,
.fleet-document-register-row {
    display: grid;
    grid-template-columns: minmax(190px, 1.5fr) minmax(130px, 0.9fr) auto auto;
    gap: 0.8rem;
    align-items: center;
    padding: 0.65rem 1rem;
}

.fleet-document-register-head {
    color: #94a3b8;
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    background: rgba(248, 250, 252, 0.82);
}

.fleet-document-register-row {
    color: #64748b;
    font-size: 0.72rem;
    border-top: 1px solid rgba(226, 232, 240, 0.62);
}

.fleet-document-register-row strong {
    color: #1e293b;
    font-size: 0.76rem;
}

.fleet-document-register-row.is-pending {
    opacity: 0.7;
}

.fleet-document-status {
    font-size: 0.66rem;
    font-weight: 800;
    white-space: nowrap;
}

.fleet-document-status.is-ready {
    color: #059669;
}

.fleet-document-status.is-pending {
    color: #b45309;
}

.fleet-document-open {
    color: #4f46e5;
    font-size: 0.7rem;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

.fleet-document-open:hover {
    text-decoration: underline;
}

.fleet-document-open.is-disabled {
    color: #94a3b8;
    cursor: default;
}

@media (max-width: 720px) {
    .fleet-documents-grid {
        grid-template-columns: 1fr;
    }

    .fleet-documents-modal-panel {
        padding: 1.15rem 1rem 1rem;
    }

    .fleet-document-register-head {
        display: none;
    }

    .fleet-document-register-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.35rem 0.6rem;
    }

    .fleet-document-register-row > :nth-child(2) {
        grid-column: 1;
        font-size: 0.64rem;
    }

    .fleet-document-register-row > :nth-child(3) {
        grid-column: 2;
        grid-row: 1;
    }

    .fleet-document-register-row > :nth-child(4) {
        grid-column: 2;
        grid-row: 2;
        align-self: end;
        margin-bottom: 0.05rem;
    }
}

.fleet-empty-state-compact {
    min-height: 110px;
}

.shop-portal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 1rem;
    margin-top: 1rem;
}

.shop-inline-tabs {
    display: inline-flex;
    align-items: center;
    gap: 0.36rem;
    padding: 0.28rem;
    border-radius: 999px;
    border: 1px solid rgba(226, 232, 240, 0.84);
    background: rgba(248, 250, 252, 0.82);
}

.shop-inline-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.95rem;
    padding: 0.42rem 0.82rem;
    border-radius: 999px;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.shop-inline-tab:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.88);
}

.shop-inline-tab-active {
    color: #4338ca;
    background: linear-gradient(180deg, rgba(238,242,255,0.96), rgba(255,255,255,0.92));
    box-shadow: 0 14px 28px -24px rgba(79, 70, 229, 0.22);
}

.shop-portal-grid-catalog-only,
.shop-portal-grid-orders-only {
    grid-template-columns: minmax(0, 1fr);
}

.shop-portal-column-hidden {
    display: none;
}

.shop-portal-stack,
.shop-orders-stack {
    display: grid;
    gap: 0.7rem;
}

.shop-product-card,
.shop-order-card,
.shop-orders-panel {
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 30px -26px rgba(15, 23, 42, 0.58);
}

.shop-product-card,
.shop-orders-panel {
    padding: 0.8rem;
}

.shop-product-rowline {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(170px, 0.8fr) minmax(220px, 1fr) minmax(190px, 0.9fr) minmax(360px, 1.3fr);
    gap: 0.75rem;
    align-items: center;
}

.shop-order-card {
    padding: 0.9rem;
}

.shop-product-head,
.shop-order-card-head,
.shop-order-card-foot {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
}

.shop-product-sku {
    margin: 0 0 0.2rem;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #94a3b8;
}

.shop-product-title {
    margin: 0;
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
    font-weight: 900;
    line-height: 1.04;
}

.shop-product-price {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid rgba(79, 70, 229, 0.16);
    background: rgba(79, 70, 229, 0.06);
    padding: 0.38rem 0.68rem;
    font-size: 0.72rem;
    font-weight: 800;
    color: #4f46e5;
    white-space: nowrap;
}

.shop-product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.38rem;
    margin-top: 0;
}

.shop-product-meta span,
.shop-order-status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.28rem 0.54rem;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.shop-product-meta span {
    border: 1px solid rgba(226, 232, 240, 0.84);
    background: #f8fafc;
    color: #64748b;
}

.shop-product-copy {
    margin: 0.56rem 0 0;
    color: #475569;
    font-size: 0.78rem;
    line-height: 1.45;
}

.shop-product-copy-inline {
    margin: 0;
}

.shop-product-availability {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    min-height: 100%;
}

.shop-product-availability strong {
    color: #0f172a;
    font-size: 1.18rem;
    line-height: 1;
    letter-spacing: -0.05em;
}

.shop-product-availability span,
.shop-product-preview,
.shop-order-card-foot,
.shop-order-card-grid span {
    color: #64748b;
    font-size: 0.7rem;
}

.shop-product-preview {
    margin-top: 0.18rem;
}

.shop-product-preview-inline {
    margin-top: 0;
}

.shop-order-form {
    margin-top: 0.7rem;
    display: grid;
    gap: 0.58rem;
}

.shop-order-form-inline {
    margin-top: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(88px, 108px) minmax(0, 1fr) auto;
    gap: 0.58rem;
    align-items: end;
}

.shop-order-form-grid,
.shop-order-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.58rem;
}

.shop-order-form-grid-inline {
    grid-template-columns: minmax(0, 1.15fr) minmax(88px, 108px) minmax(0, 1fr) auto;
    align-items: end;
}

.shop-order-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 0.8rem;
}

.shop-order-field {
    display: grid;
    gap: 0.28rem;
}

.shop-order-input,
.shop-order-textarea {
    width: 100%;
    border-radius: 0.82rem;
    border: 1px solid rgba(203, 213, 225, 0.92);
    background: #fff;
    padding: 0.58rem 0.74rem;
    font-size: 0.78rem;
    color: #0f172a;
    outline: none;
}

.shop-order-textarea {
    resize: vertical;
    min-height: 64px;
}

.shop-order-submit {
    width: fit-content;
    align-self: end;
    white-space: nowrap;
}

@media (max-width: 1360px) {
    .shop-product-rowline {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .shop-order-form-inline {
        grid-template-columns: minmax(0, 1.15fr) minmax(88px, 108px) minmax(0, 1fr) auto;
    }
}

.shop-order-card-head strong {
    display: block;
    color: #0f172a;
    font-size: 0.9rem;
}

.shop-order-card-head span {
    display: block;
    margin-top: 0.22rem;
    color: #64748b;
    font-size: 0.78rem;
}

.shop-order-card-grid strong {
    display: block;
    margin-top: 0.2rem;
    color: #0f172a;
    font-size: 0.92rem;
}

.shop-order-status-pending-payment,
.shop-order-status-reserved {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.18);
    color: #b45309;
}

.shop-order-status-paid,
.shop-order-status-fulfilled {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.18);
    color: #047857;
}

.shop-order-status-processing {
    background: rgba(79, 70, 229, 0.08);
    border: 1px solid rgba(79, 70, 229, 0.18);
    color: #4338ca;
}

.shop-order-status-cancelled,
.shop-order-status-expired {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.18);
    color: #b91c1c;
}

@media (max-width: 767px) {
    .fleet-account-meta-grid,
    .fleet-account-grid-compact,
    .shop-portal-grid,
    .shop-order-form-grid,
    .shop-order-card-grid {
        grid-template-columns: 1fr;
    }

    .fleet-compact-head,
    .fleet-toolbar-form,
    .fleet-device-row,
    .fleet-device-row-main,
    .fleet-device-row-metrics,
    .fleet-device-row-actions {
        grid-template-columns: none;
        flex-direction: column;
        align-items: stretch;
    }

    .fleet-device-row {
        gap: 0.7rem;
    }

    .fleet-device-row-metric {
        min-width: 0;
    }
}

.fleet-portal-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 0.85rem;
    align-items: start;
}

.fleet-sidebar-shell {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 0.85rem;
    min-height: calc(100vh - 2rem);
    position: sticky;
    top: 0.75rem;
}

.fleet-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.2rem 0.15rem;
}

.fleet-sidebar-brandmark {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(226, 232, 240, 0.82);
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.88));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 18px 30px -24px rgba(99, 102, 241, 0.22);
}

.fleet-sidebar-brandmark span {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    background: #4f46e5;
    box-shadow: 0 0 14px rgba(79, 70, 229, 0.45);
}

.fleet-sidebar-title {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.05;
}

.fleet-sidebar-subtitle {
    margin-top: 0.18rem;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 600;
    word-break: break-all;
}

.fleet-sidebar-nav {
    display: grid;
    gap: 0.32rem;
}

.fleet-sidebar-link-group {
    position: relative;
    display: grid;
    gap: 0.28rem;
}

.fleet-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.65rem;
    padding: 0.65rem 0.78rem;
    border-radius: 1rem;
    color: #475569;
    font-size: 0.77rem;
    font-weight: 700;
    transition: background-color 140ms ease, color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.fleet-sidebar-link:hover {
    background: rgba(248, 250, 252, 0.88);
    color: #0f172a;
}

.fleet-sidebar-link-active {
    background: linear-gradient(180deg, rgba(238,242,255,0.92), rgba(255,255,255,0.9));
    color: #4338ca;
    box-shadow: 0 16px 30px -26px rgba(79, 70, 229, 0.3);
}

.fleet-sidebar-flyout {
    position: relative;
    z-index: 4;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    margin-left: 2.2rem;
    padding: 0 0 0 0.3rem;
    border-left: 1px solid rgba(226, 232, 240, 0.9);
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease, max-height 180ms ease;
}

.fleet-sidebar-link-group:hover .fleet-sidebar-flyout,
.fleet-sidebar-link-group:focus-within .fleet-sidebar-flyout {
    opacity: 1;
    visibility: visible;
    max-height: 12rem;
    transform: translateY(0);
    pointer-events: auto;
}

.fleet-sidebar-sublink {
    display: flex;
    align-items: center;
    min-height: 1.95rem;
    padding: 0.42rem 0.72rem;
    border-radius: 0.85rem;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 800;
    white-space: nowrap;
    transition: background-color 140ms ease, color 140ms ease;
}

.fleet-sidebar-sublink:hover {
    background: rgba(248, 250, 252, 0.9);
    color: #0f172a;
}

.fleet-sidebar-sublink-active {
    background: linear-gradient(180deg, rgba(238,242,255,0.96), rgba(255,255,255,0.92));
    color: #4338ca;
    box-shadow: 0 12px 24px -24px rgba(79, 70, 229, 0.28);
}

.fleet-sidebar-link-logout {
    color: #991b1b;
    margin-top: 0.2rem;
}

.fleet-sidebar-icon {
    width: 1.2rem;
    height: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.fleet-sidebar-icon svg {
    width: 1.1rem;
    height: 1.1rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.fleet-sidebar-foot {
    margin-top: auto;
    display: grid;
    gap: 0.55rem;
}

.fleet-sidebar-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0.75rem 0.8rem;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.82);
    background: rgba(248, 250, 252, 0.86);
    color: #0f172a;
}

.fleet-sidebar-stat-label {
    color: #94a3b8;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.fleet-sidebar-stat strong {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.86rem;
    font-weight: 900;
    line-height: 1;
}

.fleet-content-shell {
    display: grid;
    gap: 0.85rem;
    min-width: 0;
}

.fleet-content-panel {
    min-width: 0;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 22px 50px -40px rgba(15, 23, 42, 0.18);
}

.fleet-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.fleet-placeholder-card {
    padding: 1rem;
    border-radius: 1.15rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    background: rgba(248, 250, 252, 0.84);
}

.fleet-placeholder-title {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.92rem;
    font-weight: 900;
}

.fleet-placeholder-copy {
    margin-top: 0.3rem;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.55;
    max-width: 58ch;
}

.fleet-transfer-list {
    display: grid;
    gap: 0.55rem;
}

.fleet-transfer-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 320px) auto;
    gap: 0.7rem;
    align-items: end;
    padding: 0.8rem 0.85rem;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    background: rgba(248, 250, 252, 0.82);
}

.fleet-transfer-serial {
    display: grid;
    gap: 0.14rem;
}

.fleet-transfer-serial strong {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.1;
}

.fleet-transfer-email {
    display: grid;
    gap: 0.24rem;
}

.fleet-transfer-button {
    min-width: 110px;
}

@media (max-width: 1100px) {
    .fleet-portal-layout {
        grid-template-columns: 1fr;
    }

    .fleet-sidebar-shell {
        min-height: auto;
        position: static;
    }
}

@media (max-width: 767px) {
    .fleet-sidebar-nav {
        grid-template-columns: 1fr;
    }

    .fleet-sidebar-flyout {
        margin-left: 1.95rem;
    }

    .fleet-section-head {
        flex-direction: column;
        align-items: stretch;
    }

    .fleet-transfer-row {
        grid-template-columns: 1fr;
    }
}

.charge-profile-summary-card {
    min-height: 108px;
}

.charge-profile-panel {
    min-width: 0;
    border: 1px solid rgba(226, 232, 240, 0.82);
    box-shadow: 0 22px 48px -40px rgba(15, 23, 42, 0.18);
}

.charge-profile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.9rem;
}

.charge-profile-head-copy {
    display: grid;
    gap: 0.28rem;
}

.charge-profile-head-note {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
}

.charge-profile-editor-shell {
    display: grid;
    gap: 0.85rem;
}

.charge-profile-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.charge-profile-mode-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem;
    border-radius: 999px;
    border: 1px solid rgba(226, 232, 240, 0.78);
    background: rgba(248, 250, 252, 0.84);
}

.charge-profile-mode-button {
    min-height: 2rem;
    padding: 0.38rem 0.8rem;
    border-radius: 999px;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.charge-profile-mode-button.is-active {
    background: linear-gradient(180deg, rgba(238,242,255,0.96), rgba(255,255,255,0.92));
    color: #4338ca;
    box-shadow: 0 12px 28px -24px rgba(79, 70, 229, 0.45);
}

.charge-profile-readout {
    display: inline-grid;
    gap: 0.14rem;
    justify-items: end;
}

.charge-profile-readout-label {
    color: #94a3b8;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.charge-profile-readout-value {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.92rem;
    font-weight: 900;
}

.charge-profile-graph-card {
    padding: 0.95rem 1rem;
    border-radius: 1.2rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.06), transparent 18%),
        radial-gradient(circle at bottom right, rgba(79, 70, 229, 0.07), transparent 22%),
        linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.96));
    box-shadow: inset 0 0 44px rgba(255, 255, 255, 0.75), 0 24px 58px -42px rgba(15, 23, 42, 0.24);
}

.charge-profile-chart-shell {
    position: relative;
    width: 100%;
    height: 420px;
    border-radius: 1rem;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.95), rgba(248,250,252,0.92)),
        radial-gradient(circle at top left, rgba(255,255,255,0.85), transparent 28%);
}

.charge-profile-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

.charge-profile-step-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
}

.charge-profile-step-grid-compact {
    gap: 0.5rem;
}

.charge-profile-step-card {
    display: grid;
    gap: 0.7rem;
    padding: 0.72rem 0.8rem;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.92));
    transition: border-color 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.charge-profile-step-card.is-muted {
    opacity: 0.52;
}

.charge-profile-step-card.is-selected {
    border-color: rgba(99, 102, 241, 0.34);
    box-shadow: 0 20px 38px -32px rgba(79, 70, 229, 0.34);
}

.charge-profile-step-card-head,
.charge-profile-step-card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.charge-profile-step-meta {
    display: grid;
    gap: 0.12rem;
    justify-items: end;
}

.charge-profile-step-meta span {
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 700;
}

.charge-profile-step-meta strong {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.86rem;
    font-weight: 900;
}

.charge-profile-terminal {
    min-height: 58px;
    padding: 0 1rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(226, 232, 240, 0.78);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.96));
    color: #67e8f9;
    display: flex;
    align-items: center;
    font-family: 'Space Mono', 'Fira Code', monospace;
    font-size: 0.76rem;
    box-shadow: inset 0 0 28px rgba(6, 182, 212, 0.08);
}

.charge-profile-hidden-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.charge-profile-step-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    min-width: 2.2rem;
    padding: 0.3rem 0.55rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(226, 232, 240, 0.82);
    background: rgba(248, 250, 252, 0.9);
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.82rem;
    font-weight: 800;
}

.charge-profile-select,
.charge-profile-input {
    min-height: 2.5rem;
}

@media (max-width: 1100px) {
    .charge-profile-step-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .charge-profile-head {
        flex-direction: column;
        align-items: stretch;
    }

    .charge-profile-table-head {
        display: none;
    }

    .charge-profile-chart-shell {
        height: 320px;
    }

    .charge-profile-step-grid {
        grid-template-columns: 1fr;
    }

    .charge-profile-step-card-head,
    .charge-profile-step-card-body {
        align-items: stretch;
    }

    .charge-profile-step-card-body {
        flex-direction: column;
    }

    .charge-profile-step-meta {
        justify-items: start;
    }
}

.inverter-power-flow-shell {
    width: 100%;
}

#inverterPowerFlowCard {
    display: block;
    width: 100%;
}

ha-card {
    display: block;
}

.inverter-shell-v4 {
    min-height: 38rem;
}

.inverter-card-original-shell {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
}

.inverter-card-original-shell power-flow-card-plus {
    display: block;
    width: 100%;
}

.inverter-card-original-shell ha-card,
.inverter-card-original-shell .card {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
}

.inverter-card-error {
    padding: 1rem;
    color: #0f172a;
    font-size: 0.95rem;
}

@media (max-width: 767px) {
    .inverter-shell-v4 {
        min-height: 30rem;
    }
}

.shop-product-table-row {
    display: grid;
    grid-template-columns: minmax(260px, 1.8fr) minmax(110px, 0.7fr) minmax(130px, 0.8fr) minmax(96px, 0.55fr) minmax(130px, 0.8fr) auto;
    gap: 0.65rem;
    align-items: center;
}

.shop-product-col {
    min-width: 0;
}

.shop-product-col-label {
    display: block;
    margin-bottom: 0.18rem;
    color: #94a3b8;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.shop-product-col strong {
    display: block;
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.15;
}

.shop-product-col-model .shop-product-sku {
    margin-bottom: 0.1rem;
}

.shop-product-col-model .shop-product-title {
    font-size: 0.92rem;
}

.shop-product-col-qty .shop-order-input,
.shop-product-col-code .shop-order-input {
    min-width: 0;
}

.shop-product-col-submit {
    display: flex;
    align-items: end;
}

.shop-product-col-submit .shop-order-submit {
    width: 100%;
    align-self: center;
}

.factory-battery-control-trigger {
    min-height: 2.35rem;
    width: 100%;
    border-radius: 0.95rem;
    border: 1px solid rgba(199, 210, 254, 0.95);
    background: linear-gradient(180deg, rgba(238, 242, 255, 0.96), rgba(255, 255, 255, 0.94));
    color: #4338ca;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.factory-battery-control-trigger:hover {
    border-color: rgba(129, 140, 248, 0.95);
    box-shadow: 0 16px 28px -24px rgba(79, 70, 229, 0.52);
    transform: translateY(-1px);
}

.factory-remote-modal {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 1;
    visibility: visible;
    transition: opacity 180ms ease, visibility 180ms ease;
}

.factory-remote-modal[aria-hidden="true"] {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.factory-remote-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(148, 163, 184, 0.46);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.factory-remote-panel {
    position: relative;
    z-index: 1;
    width: min(100%, 520px);
    border-radius: 1.7rem;
    border: 1px solid rgba(226, 232, 240, 0.92);
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96));
    box-shadow: 0 36px 80px -48px rgba(15, 23, 42, 0.42);
    padding: 1.15rem;
}

.factory-remote-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: rgba(248, 250, 252, 0.96);
    color: #64748b;
    font-size: 1.4rem;
    line-height: 1;
}

.factory-remote-kicker {
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.factory-remote-title {
    margin-top: 0.35rem;
    color: #0f172a;
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    line-height: 1;
}

.factory-remote-device-label {
    margin-top: 0.6rem;
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 700;
}

.factory-remote-status {
    min-height: 1.4rem;
    margin-top: 0.55rem;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
}

.factory-remote-status[data-tone="error"] { color: #b91c1c; }
.factory-remote-status[data-tone="success"] { color: #047857; }
.factory-remote-status[data-tone="active"] { color: #b91c1c; }

.factory-remote-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.9rem;
}

.factory-remote-action-card {
    display: grid;
    gap: 0.45rem;
}

.factory-remote-action-button,
.factory-remote-unlock-button {
    min-height: 3rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(203, 213, 225, 0.9);
    background: rgba(255, 255, 255, 0.96);
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.factory-remote-unlock-button {
    min-height: 2.35rem;
    background: rgba(248, 250, 252, 0.96);
}

.factory-remote-action-button.is-active {
    color: #fff;
    border-color: rgba(239, 68, 68, 0.92);
    background: linear-gradient(180deg, rgba(220, 38, 38, 0.94), rgba(185, 28, 28, 0.96));
    animation: remoteActionFlash 0.95s ease-in-out infinite;
    box-shadow: 0 18px 34px -24px rgba(239, 68, 68, 0.52);
}

.factory-remote-action-button:disabled,
.factory-remote-unlock-button:disabled,
.factory-battery-control-trigger:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.factory-remote-soc-reset {
    width: 100%;
    min-height: 2.5rem;
    margin-top: 0.8rem;
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 0.8rem;
    background: rgba(255, 251, 235, 0.9);
    color: #b45309;
    font-weight: 700;
    cursor: pointer;
}

.factory-remote-soc-reset:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.factory-remote-note {
    margin: 0.55rem 0 0;
    color: #64748b;
    font-size: 0.68rem;
    line-height: 1.45;
}

.remote-control-notice-panel {
    max-width: 42rem;
}

.remote-control-notice-hint {
    margin-top: 0.9rem;
    color: #b91c1c;
    font-size: 0.78rem;
    font-weight: 700;
}

.remote-control-notice-hint[aria-hidden="true"] {
    display: none;
}

.remote-badge-critical {
    background: rgba(254, 226, 226, 0.98);
    color: #b91c1c;
}

.remote-restricted-panel {
    position: relative;
    pointer-events: none;
    opacity: 0.74;
}

.remote-restricted-panel::after {
    content: 'Acces limitat de o masura remote activa';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: start;
    justify-content: center;
    padding-top: 1rem;
    border-radius: 1.2rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.56), rgba(248,250,252,0.22));
    color: #b91c1c;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.topbar-link.remote-page-locked {
    opacity: 0.52;
    cursor: not-allowed;
    border-color: rgba(248, 113, 113, 0.32);
    color: #b91c1c;
}

@keyframes remoteActionFlash {
    0%, 100% {
        box-shadow: 0 18px 34px -24px rgba(239, 68, 68, 0.34);
        transform: translateY(0);
    }
    50% {
        box-shadow: 0 22px 42px -22px rgba(239, 68, 68, 0.56), 0 0 0 3px rgba(254, 202, 202, 0.42);
        transform: translateY(-1px);
    }
}

@media (max-width: 1360px) {
    .shop-product-table-row {
        grid-template-columns: 1fr;
        gap: 0.45rem;
    }

    .shop-product-col-submit {
        display: block;
    }

    .shop-product-col-submit .shop-order-submit {
        width: fit-content;
    }

    .factory-remote-grid {
        grid-template-columns: 1fr;
    }
}

.shop-product-table-row {
    display: grid;
    grid-template-columns: minmax(240px, 1.5fr) minmax(110px, 0.7fr) minmax(120px, 0.8fr) minmax(90px, 0.6fr) minmax(120px, 0.8fr) auto;
    gap: 0.65rem;
    align-items: center;
}

.shop-product-col {
    min-width: 0;
}

.shop-product-col-label {
    display: block;
    margin-bottom: 0.18rem;
    color: #94a3b8;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.shop-product-col strong {
    display: block;
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.15;
}

.shop-product-col-model .shop-product-sku {
    margin-bottom: 0.1rem;
}

.shop-product-col-submit {
    display: flex;
    align-items: end;
}

.shop-product-col-submit .shop-order-submit {
    width: 100%;
    align-self: center;
}

@media (max-width: 1360px) {
    .shop-product-table-row {
        grid-template-columns: 1fr;
        gap: 0.45rem;
    }

    .shop-product-col-submit {
        display: block;
    }

    .shop-product-col-submit .shop-order-submit {
        width: fit-content;
    }
}
.dashboard-power-arrow {
    font-size: 0;
    line-height: 1;
}

.dashboard-power-arrow::before {
    content: "\2193";
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.dashboard-power-arrow[data-direction="up"]::before {
    content: "\2191";
}
.soc-calibration-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 120;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 52rem;
    margin: 0 auto;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(16, 185, 129, 0.55);
    border-radius: 0.9rem;
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.96), rgba(5, 46, 38, 0.96));
    color: #ecfdf5;
    box-shadow: 0 16px 40px rgba(2, 6, 23, 0.35);
    transition: opacity 160ms ease, transform 160ms ease;
}

.soc-calibration-banner[aria-hidden="true"],
.soc-calibration-cancelled-modal[aria-hidden="true"] {
    display: none;
}

.soc-calibration-banner-icon {
    display: grid;
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
    place-items: center;
    border-radius: 999px;
    background: rgba(52, 211, 153, 0.18);
    color: #6ee7b7;
    font-size: 1.25rem;
    font-weight: 800;
}

.soc-calibration-banner-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.78rem;
    line-height: 1.35;
}

.soc-calibration-banner-copy strong {
    font-size: 0.86rem;
    font-weight: 800;
}

.soc-calibration-banner-copy span {
    color: #a7f3d0;
}

.soc-calibration-cancelled-modal {
    position: fixed;
    inset: 0;
    z-index: 140;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.soc-calibration-cancelled-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(3px);
}

.soc-calibration-cancelled-panel {
    position: relative;
    width: min(100%, 30rem);
    padding: 1.35rem;
    border: 1px solid rgba(248, 113, 113, 0.7);
    border-radius: 1rem;
    background: #111c2f;
    color: #f8fafc;
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.5);
}

.soc-calibration-cancelled-title {
    margin: 0;
    color: #fca5a5;
    font-size: 1.05rem;
    font-weight: 800;
}

.soc-calibration-cancelled-copy {
    margin: 0.7rem 0 1rem;
    color: #cbd5e1;
    font-size: 0.84rem;
    line-height: 1.5;
}

.soc-calibration-cancelled-button {
    width: 100%;
    padding: 0.62rem 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 0.65rem;
    background: #1e3a5f;
    color: #f8fafc;
    cursor: pointer;
    font-weight: 700;
}

/*
 * Desktop keeps one visual system across laptop, monitor and ultrawide
 * resolutions.  The whole desktop canvas scales proportionally, so spacing,
 * typography, cards and modals retain the same proportions.  The mobile
 * breakpoint below disables this scaling and leaves the dedicated mobile
 * layout in control.
 */
@media (min-width: 768px) {
    body {
        --desktop-ui-scale: clamp(0.78, calc(100vw * 0.0005208333), 1.08);
        zoom: var(--desktop-ui-scale);
    }
}

@media (max-width: 767px) {
    body {
        zoom: 1;
    }

    /* Give long operating states enough room in the three-column mobile hero. */
    .dashboard-mobile-primary-grid {
        grid-template-columns: minmax(0, 0.92fr) minmax(0, 0.92fr) minmax(0, 1.3fr);
    }

    .dashboard-mobile-primary-stat {
        overflow: hidden;
    }

    .dashboard-mobile-status-stat {
        container-type: inline-size;
        padding-inline: 0.65rem;
    }

    .dashboard-mobile-status-value {
        display: block;
        max-width: 100%;
        overflow: hidden;
        white-space: nowrap;
        letter-spacing: -0.055em;
        font-size: clamp(0.875rem, 4.8vw, 1.25rem) !important;
    }
}

/* Compact, touch-friendly navigation for phones. */
.topbar-mobile-menu {
    display: none;
}

@media (max-width: 767px) {
    .topbar-nav {
        display: none !important;
    }

    .topbar-mobile-menu {
        display: block !important;
        position: relative;
        width: 100%;
        z-index: 8;
    }

    .topbar-mobile-menu-summary {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        min-height: 2.7rem;
        padding: 0.7rem 0.85rem;
        border: 1px solid rgba(165, 180, 252, 0.52);
        border-radius: 0.9rem;
        background: linear-gradient(135deg, rgba(238, 242, 255, 0.98), rgba(255, 255, 255, 0.95));
        color: #334155;
        cursor: pointer;
        list-style: none;
        box-shadow: 0 12px 24px -22px rgba(79, 70, 229, 0.48);
    }

    .topbar-mobile-menu-summary::-webkit-details-marker { display: none; }
    .topbar-mobile-menu-icon { color: #4f46e5; font-size: 1rem; line-height: 1; }
    .topbar-mobile-menu-current { flex: 1; min-width: 0; overflow: hidden; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.02em; text-overflow: ellipsis; white-space: nowrap; }
    .topbar-mobile-menu-chevron { color: #64748b; font-size: 1rem; line-height: 1; transition: transform 160ms ease; }
    .topbar-mobile-menu[open] .topbar-mobile-menu-chevron { transform: rotate(180deg); }
    .topbar-mobile-menu-panel { display: grid; gap: 0.35rem; margin-top: 0.45rem; padding: 0.45rem; border: 1px solid rgba(226, 232, 240, 0.9); border-radius: 0.9rem; background: rgba(255, 255, 255, 0.98); box-shadow: 0 20px 40px -28px rgba(15, 23, 42, 0.35); }
    .topbar-mobile-link { display: flex; align-items: center; justify-content: space-between; min-height: 2.55rem; padding: 0.65rem 0.75rem; border-radius: 0.7rem; color: #475569; font-size: 0.72rem; font-weight: 700; text-decoration: none; }
    .topbar-mobile-link:hover, .topbar-mobile-link-active { background: #eef2ff; color: #4f46e5; }
}
