/* The slot keeps the original footprint while the same card grows over the next row. */
.mynq-body .node-list {
    margin-top: 0;
}

.node-list .node-box,
.node-list .node-box > .el-card__body,
.node-list .el-skeleton {
    overflow: visible;
}

.node-list .node-slot {
    position: relative;
    box-sizing: border-box;
    min-width: 0;
}

.node-list .node-slot-grid {
    float: left;
    width: calc(25% - 20px);
    margin: 10px;
}

.node-list .node-slot-list + .node-slot-list {
    margin-top: 10px;
}

.el-main .node-box .node-slot > .el-card {
    position: relative;
    box-sizing: border-box;
    float: none;
    width: 100%;
    max-width: none;
    margin: 0;
}

.node-list .node-slot-grid .node-summary {
    min-height: 151px;
}

.node-list .node-slot-expanded {
    z-index: 10;
}

.el-main .node-box .node-slot-expanded > .el-card {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    background: #f4f7fa;
    transition: height 240ms cubic-bezier(.2, .7, .2, 1), box-shadow 240ms ease;
    box-shadow: 0 16px 36px rgba(12, 25, 43, .28);
}

.node-card-history {
    box-sizing: border-box;
    height: 240px;
    padding-top: 12px;
    color: #34495c;
    cursor: default;
}

.node-card-history [hidden] {
    display: none !important;
}

.node-card-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    height: 26px;
}

.node-card-history-title {
    min-width: 0;
    color: #34495c;
    font-size: 13px;
    line-height: 20px;
}

.node-card-hour,
.node-card-realtime {
    min-width: 0;
}

.node-card-history-list {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(0, 3fr);
    gap: 24px;
}

.node-card-realtime .node-card-history-header {
    justify-content: center;
}

.node-card-cpu-gauge {
    --node-cpu-angle: 0deg;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 136px;
    height: 136px;
    margin: 12px auto 8px;
    border-radius: 50%;
    color: #246d89;
    background: conic-gradient(#328eac var(--node-cpu-angle), rgba(78, 113, 137, .13) 0);
}

.node-card-cpu-gauge::before {
    content: "";
    position: absolute;
    inset: 9px;
    border-radius: inherit;
    background: #f4f7fa;
}

.node-card-cpu-value {
    position: relative;
    font-size: 30px;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.node-card-cpu-gauge.is-unavailable {
    color: #718394;
}

.node-card-cpu-status {
    color: #52616f;
    text-align: center;
    font-size: 12px;
    line-height: 20px;
}

/* One desktop toolbar: title, actions, then the display mode control. */
.dashboard-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 12px 0;
}

.el-main .dashboard-toolbar h2.title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    line-height: 1.4;
}

.dashboard-toolbar h2.title sub {
    display: inline-block;
    white-space: nowrap;
}

.dashboard-toolbar-controls,
.dashboard-toolbar-actions {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 12px;
}

.dashboard-toolbar .el-link.edit-buttion {
    float: none;
    min-height: 36px;
    margin: 0;
    z-index: auto;
    white-space: nowrap;
}

.dashboard-toolbar .node-list-mode-box {
    display: flex;
    justify-content: flex-end;
    width: auto;
    margin: 0;
    padding: 0;
    background: transparent;
}

.dashboard-toolbar .node-list-mode {
    display: inline-flex;
    gap: 4px;
    width: auto;
    height: auto;
    margin: 0;
    padding: 4px;
    line-height: normal;
    border: 1px solid rgba(255, 255, 255, .4);
    border-radius: 12px;
    background: #dce6ee;
    box-shadow: 0 4px 16px rgba(8, 27, 46, .12);
}

.dashboard-toolbar .node-list-mode-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: auto;
    min-width: 76px;
    height: 36px;
    padding: 0 13px;
    border-radius: 8px;
    color: #344f65;
    font: inherit;
    font-size: 13px;
    transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.dashboard-toolbar .node-list-mode-btn svg {
    width: 14px;
    height: 14px;
    color: inherit;
}

.dashboard-toolbar .node-list-mode-btn:hover {
    color: #164d76;
    background: rgba(255, 255, 255, .45);
}

.dashboard-toolbar .node-list-mode-btn.is-active {
    color: #1c6189;
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 2px 8px rgba(27, 61, 89, .12);
}

.dashboard-toolbar .node-list-mode-btn.is-active svg,
.dashboard-toolbar .node-list-mode-btn:hover svg {
    color: inherit;
}

.dashboard-toolbar .node-list-mode-btn:focus-visible {
    outline: 2px solid #246d99;
    outline-offset: 2px;
}

.node-card-history-chart,
.node-card-history-status {
    width: 100%;
    height: 190px;
    margin-top: 8px;
}

.node-card-history-status {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #52616f;
    text-align: center;
    font-size: 13px;
}

.node-list .node[data-node-id]:focus-visible,
.node-list .mynode[data-node-id]:focus-visible {
    outline: 2px solid #559ac6;
    outline-offset: 2px;
}

@media (max-width: 1399px) {
    .node-list .node-slot-grid { width: calc(33.333333% - 20px); }
}

@media (max-width: 1023px) {
    .node-list .node-slot-grid { width: calc(50% - 20px); }
}

@media (max-width: 767px) {
    .dashboard-toolbar {
        flex-wrap: wrap;
        gap: 10px;
    }

    .el-main .dashboard-toolbar h2.title {
        flex-basis: 100%;
    }

    .dashboard-toolbar-controls {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 10px;
    }
}

@media (max-width: 420px) {
    .dashboard-toolbar-actions { gap: 8px; }
    .dashboard-toolbar .node-list-mode-btn {
        min-width: 64px;
        padding-right: 8px;
        padding-left: 8px;
        gap: 5px;
    }
}

@media (max-width: 639px) {
    .node-list .node-slot-grid { width: calc(100% - 20px); }
    .node-card-history-list {
        height: 464px;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: 216px 224px;
        gap: 8px;
    }
}

/* Blur only the raised card, so underlying rows do not compete with its chart. */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .dashboard-toolbar .node-list-mode {
        background: rgba(228, 239, 248, .68);
        -webkit-backdrop-filter: blur(14px) saturate(125%);
        backdrop-filter: blur(14px) saturate(125%);
    }

    .mynq-body .node-box .node-slot-expanded > .el-card {
        background: rgba(247, 250, 253, .9);
        -webkit-backdrop-filter: blur(16px) saturate(125%);
        backdrop-filter: blur(16px) saturate(125%);
    }
}

@media (prefers-reduced-transparency: reduce) {
    .dashboard-toolbar .node-list-mode {
        background: #dce6ee;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .mynq-body .node-box .node-slot-expanded > .el-card {
        background: #f4f7fa;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .el-main .node-box .node-slot-expanded > .el-card,
    .dashboard-toolbar .node-list-mode-btn { transition: none; }
}
