.sp-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-secondary, #cbd5e1);
    font-size: var(--fs-label, 11px);
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
}

.sp-chip:hover {
    border-color: rgba(167, 139, 250, 0.48);
    background: rgba(167, 139, 250, 0.13);
    color: #ddd6fe;
}

.sp-chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 4px rgba(34, 197, 94, 0.75);
}

.sp-chip-title {
    color: var(--text-strong, #e2e8f0);
    font-weight: 600;
}

#server-pulse-settings-anchor .sp-chip .sp-chip-title,
#server-pulse-settings-anchor .sp-chip .sp-chip-value {
    font-size: var(--fs-label, 10px);
    font-weight: 600;
}

.sp-chip-value {
    display: inline-flex;
    align-items: center;
    padding: 1px 5px;
    border-radius: 8px;
    border: 1px solid rgba(167, 139, 250, 0.35);
    background: rgba(167, 139, 250, 0.12);
    color: #ddd6fe;
    font-size: var(--fs-label, 10px);
}

.sp-chip.is-green {
    border-color: rgba(34, 197, 94, 0.45);
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
}

.sp-chip.is-amber {
    border-color: rgba(251, 191, 36, 0.48);
    background: rgba(251, 191, 36, 0.14);
    color: #fde68a;
}

.sp-chip.is-red {
    border-color: rgba(248, 113, 113, 0.5);
    background: rgba(248, 113, 113, 0.14);
    color: #fecaca;
}

.sp-fallback-overlay {
    position: fixed;
    inset: 0;
    z-index: 1198;
    display: none;
    background: rgba(2, 6, 23, 0.45);
}

.sp-fallback-overlay.active {
    display: block;
}

.sp-fallback-card {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    width: min(760px, calc(100vw - 48px));
    max-height: min(88vh, 860px);
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(139, 92, 246, 0.28);
    background: rgba(15, 10, 30, 0.94);
    backdrop-filter: blur(16px);
    z-index: 1199;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
}

.sp-fallback-card.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.sp-fallback-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.sp-fallback-title {
    color: #c4b5fd;
    font-size: var(--fs-strong, 13px);
    font-weight: 700;
}

.sp-fallback-close {
    border: 0;
    background: transparent;
    color: #94a3b8;
    font-size: var(--fs-kpi, 22px);
    cursor: pointer;
}

.sp-fallback-body {
    max-height: calc(min(88vh, 860px) - 50px);
    overflow: auto;
    padding: 12px;
}

.sp-cockpit {
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: #e2e8f0;
}

.sp-hero {
    border: 1px solid rgba(167, 139, 250, 0.24);
    border-radius: 14px;
    background:
        radial-gradient(circle at 50% 18%, rgba(139, 92, 246, 0.16), transparent 40%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.34), rgba(2, 6, 23, 0.22));
    padding: 8px 8px 10px;
}

.sp-hero-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.sp-kicker {
    color: #94a3b8;
    font-size: var(--fs-label, 11px);
    letter-spacing: 0.08em;
}

.sp-title {
    color: #f8fafc;
    font-size: var(--fs-strong, 15px);
    font-weight: 700;
}

.sp-window {
    color: #94a3b8;
    font-size: var(--fs-label, 11px);
    text-align: right;
}

.sp-hero-graph {
    width: 100%;
    height: clamp(400px, 56vh, 460px);
    min-height: 400px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.22);
    overflow: hidden;
}

.sp-map-svg {
    display: block;
}

.sp-map-core-title {
    font-size: var(--fs-kpi, 18px);
    font-weight: 700;
}

.sp-map-core-subtitle,
.sp-map-help,
.sp-domain-count,
.sp-domain-toggle-label {
    font-size: var(--fs-label, 11px);
}

.sp-domain-title {
    font-size: var(--fs-strong, 13px);
    font-weight: 700;
}

.sp-node-label,
.sp-edge-label {
    font-size: var(--fs-label, 10px);
}

.sp-mind-branch,
.sp-domain-toggle,
.sp-node-card {
    cursor: pointer;
}

.sp-mind-branch-line {
    transition: stroke-opacity 0.18s ease, stroke-width 0.18s ease;
}

.sp-node-connector {
    pointer-events: none;
}

.sp-domain-output-pin {
    filter: drop-shadow(0 0 6px rgba(167, 139, 250, 0.2));
    pointer-events: none;
}

.sp-mind-branch:hover .sp-mind-branch-line {
    stroke-opacity: 0.8;
    stroke-width: 2.4;
}

.sp-mind-root {
    filter: drop-shadow(0 0 14px rgba(167, 139, 250, 0.22));
}

.sp-root-output-pin {
    filter: drop-shadow(0 0 8px rgba(167, 139, 250, 0.24));
}

.sp-node-card.is-focused text {
    fill: #f8fafc;
}

.sp-node-card.is-active text {
    fill: #ffffff;
    font-weight: 700;
}

.sp-edge-line.is-focused text {
    fill: #ddd6fe;
}

.sp-command-console {
    margin-top: 8px;
    border: 1px solid rgba(167, 139, 250, 0.25);
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.55);
    padding: 8px;
}

.sp-console-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
}

.sp-console-head > div {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: #94a3b8;
    font-size: var(--fs-label, 11px);
}

.sp-console-head b {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(34, 211, 238, 0.32);
    border-radius: 999px;
    background: rgba(14, 116, 144, 0.18);
    color: #cffafe;
    font-size: var(--fs-primary, 12px);
    padding: 2px 8px;
}

.sp-strategy-rail {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.sp-strategy-rail::before {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    top: 50%;
    height: 1px;
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.2), rgba(167, 139, 250, 0.35), rgba(236, 72, 153, 0.18));
    transform: translateY(-50%);
    pointer-events: none;
}

.sp-strategy-step {
    position: relative;
    z-index: 1;
    min-height: 50px;
    border: 1px solid rgba(139, 92, 246, 0.28);
    background: rgba(15, 23, 42, 0.78);
    color: #e2e8f0;
    border-radius: 10px;
    padding: 7px 9px;
    text-align: left;
    cursor: pointer;
}

.sp-strategy-step i,
.sp-strategy-step span,
.sp-strategy-step small,
.sp-strategy-step em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-strategy-step i {
    color: #22d3ee;
    font-size: var(--fs-strong, 13px);
    font-style: normal;
    line-height: 1;
}

.sp-strategy-step span {
    margin-top: 3px;
    color: #f8fafc;
    font-size: var(--fs-primary, 12px);
    font-weight: 700;
}

.sp-strategy-step small {
    margin-top: 3px;
    color: #94a3b8;
    font-size: var(--fs-label, 10px);
}

.sp-strategy-step em {
    margin-top: 3px;
    color: rgba(196, 181, 253, 0.82);
    font-size: var(--fs-label, 10px);
    font-style: normal;
}

.sp-strategy-step.is-active {
    border-color: rgba(34, 211, 238, 0.68);
    background-color: rgba(8, 47, 73, 0.72);
    background-image: linear-gradient(180deg, rgba(34, 211, 238, 0.24), rgba(139, 92, 246, 0.16));
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.12), 0 0 18px rgba(34, 211, 238, 0.12);
}

.sp-strategy-step.is-active i {
    color: #67e8f9;
}

.sp-action-btn,
.sp-map-reset {
    border: 1px solid rgba(139, 92, 246, 0.28);
    background: rgba(139, 92, 246, 0.14);
    color: #e2e8f0;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: var(--fs-primary, 12px);
    cursor: pointer;
}

.sp-strategy-step:hover,
.sp-action-btn:hover,
.sp-map-reset:hover {
    border-color: rgba(167, 139, 250, 0.58);
    background: rgba(167, 139, 250, 0.2);
}

.sp-console-switches {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.sp-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #cbd5e1;
    font-size: var(--fs-label, 11px);
}

.sp-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.sp-switch span {
    width: 30px;
    height: 16px;
    border-radius: 999px;
    background: rgba(71, 85, 105, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.28);
    position: relative;
}

.sp-switch span::after {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    left: 2px;
    top: 1px;
    border-radius: 999px;
    background: #cbd5e1;
    transition: transform 0.18s ease, background 0.18s ease;
}

.sp-switch input:checked + span {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.45);
}

.sp-switch input:checked + span::after {
    transform: translateX(14px);
    background: #86efac;
}

.sp-command-rollback,
.sp-command-status {
    color: #cbd5e1;
    font-size: var(--fs-label, 11px);
}

.sp-command-rollback {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.58);
    padding: 3px 8px;
}

.sp-command-rollback input {
    width: 56px;
    color-scheme: dark;
    appearance: textfield;
    -moz-appearance: textfield;
    background: rgba(2, 6, 23, 0.72);
    border: 1px solid rgba(167, 139, 250, 0.38);
    color: #e2e8f0;
    border-radius: 7px;
    padding: 2px 6px;
    font-size: var(--fs-label, 11px);
}

.sp-command-rollback input::-webkit-outer-spin-button,
.sp-command-rollback input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.sp-command-rollback input:focus {
    outline: 1px solid rgba(34, 211, 238, 0.56);
    border-color: rgba(34, 211, 238, 0.62);
}

.sp-action-status {
    margin-top: 6px;
    color: #22d3ee;
    font-size: var(--fs-primary, 12px);
}

.sp-active-path,
.sp-diagnostics {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
}

.sp-active-path {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.sp-active-path div {
    min-width: 0;
}

.sp-active-path b {
    display: block;
    color: #a78bfa;
    font-size: var(--fs-label, 11px);
    margin-bottom: 3px;
}

.sp-active-path span {
    color: #e2e8f0;
    font-size: var(--fs-primary, 12px);
}

.sp-active-path-route {
    grid-column: 1 / span 4;
    border-top: 1px dashed rgba(148, 163, 184, 0.3);
    padding-top: 6px;
}

.sp-section-title {
    color: #c4b5fd;
    font-size: var(--fs-primary, 12px);
    font-weight: 700;
    margin: 8px 0 6px;
}

.sp-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.sp-kpi {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    border: 1px dashed rgba(148, 163, 184, 0.22);
    border-radius: 8px;
    padding: 6px;
    font-size: var(--fs-primary, 12px);
    color: #e2e8f0;
}

.sp-kpi b {
    color: #c4b5fd;
    font-weight: 600;
}

.sp-status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: var(--fs-label, 11px);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #e2e8f0;
}

.sp-status-pill.is-healthy {
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.4);
}

.sp-status-pill.is-warning {
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.45);
}

.sp-status-pill.is-critical {
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.5);
}

.sp-status-pill.is-standby {
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.45);
}

.sp-anomaly-title {
    color: #f59e0b;
    margin-top: 8px;
    margin-bottom: 4px;
    font-size: var(--fs-primary, 12px);
    font-weight: 700;
}

.sp-anomaly,
.sp-cp-hint {
    color: #fca5a5;
    font-size: var(--fs-label, 11px);
    line-height: 1.4;
    margin: 3px 0;
}

.sp-cp-chain {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    padding: 6px 8px;
    margin-bottom: 6px;
    background: rgba(2, 6, 23, 0.35);
}

.sp-cp-chain b {
    color: #e2e8f0;
    font-size: var(--fs-primary, 12px);
}

.sp-cp-chain span {
    color: #94a3b8;
    font-size: var(--fs-label, 11px);
}

.sp-log-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 6px;
    margin-top: 6px;
    padding: 6px;
    border: 1px dashed rgba(148, 163, 184, 0.25);
    border-radius: 8px;
}

.sp-log-row b {
    color: #f8fafc;
    font-size: var(--fs-label, 11px);
}

.sp-log-row span {
    color: #94a3b8;
    font-size: var(--fs-label, 11px);
    text-align: right;
}

.sp-log-row em {
    grid-column: 1 / span 2;
    color: #a5b4fc;
    font-style: normal;
    font-size: var(--fs-label, 11px);
}

.sp-empty {
    color: #94a3b8;
    font-size: var(--fs-primary, 12px);
}

.sp-diagnostics-wrap {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
}

.sp-diagnostics-wrap > summary {
    list-style: none;
    cursor: pointer;
    padding: 10px 12px;
    color: #c4b5fd;
    font-size: var(--fs-primary, 12px);
    font-weight: 700;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.sp-diagnostics-wrap > summary::-webkit-details-marker {
    display: none;
}

.sp-diagnostics-wrap[open] > summary {
    background: rgba(76, 29, 149, 0.12);
}

.sp-diagnostics-wrap .sp-diagnostics {
    border: 0;
    background: transparent;
}

.sp-kernel-capsule-slot:empty {
    min-width: 0;
}

@media (max-width: 900px) {
    .sp-hero-graph {
        height: 430px;
        min-height: 380px;
    }
    .sp-active-path,
    .sp-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .sp-active-path-route {
        grid-column: 1 / span 2;
    }
    .sp-command-console {
        border-radius: 12px;
    }
    .sp-strategy-rail {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
