.rbx-wrap {
    --rbx-panel: rgba(255, 255, 255, .72);
    --rbx-line: rgba(80, 100, 150, .28);
    --rbx-soft: rgba(80, 100, 150, .12);
    --rbx-blue: #2f81f7;
    --rbx-green: #3ddc84;
    --rbx-orange: #ffb020;
    --rbx-red: #ff5d5d;
    --rbx-purple: #a371f7;
}

html.theme-night .rbx-wrap {
    --rbx-panel: rgba(255, 255, 255, .045);
    --rbx-line: rgba(160, 180, 230, .22);
    --rbx-soft: rgba(160, 180, 230, .1);
}

.rbx-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 6px 0 16px;
}

.rbx-status {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: .85rem;
    opacity: .9;
}

.rbx-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #8b95a5;
    display: inline-block;
    flex: none;
}

.rbx-dot.live { background: var(--rbx-green); box-shadow: 0 0 0 0 rgba(61, 220, 132, .6); animation: rbxPulse 2s infinite; }
.rbx-dot.idle { background: var(--rbx-orange); }
.rbx-dot.off { background: var(--rbx-red); }

@keyframes rbxPulse {
    0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, .55); }
    70% { box-shadow: 0 0 0 9px rgba(61, 220, 132, 0); }
    100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); }
}

.rbx-pills {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--rbx-line);
    border-radius: 999px;
    background: var(--rbx-panel);
}

.rbx-pill {
    border: 0;
    background: transparent;
    color: inherit;
    padding: 6px 15px;
    border-radius: 999px;
    font: inherit;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    opacity: .72;
    transition: background .2s, opacity .2s;
}

.rbx-pill:hover { opacity: 1; }
.rbx-pill.active { background: var(--rbx-blue); color: #fff; opacity: 1; }

.rbx-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: 12px;
}

.rbx-kpi {
    border: 1px solid var(--rbx-line);
    border-top: 3px solid var(--c, var(--rbx-blue));
    background: var(--rbx-panel);
    border-radius: 16px;
    padding: 14px 16px 12px;
    min-width: 0;
}

.rbx-kpi .l {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    opacity: .65;
}

.rbx-kpi .v {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
    margin: 3px 0 2px;
    overflow-wrap: anywhere;
}

.rbx-kpi .s {
    font-size: .76rem;
    opacity: .72;
    min-height: 1.1em;
}

.rbx-kpi .s.up { color: var(--rbx-green); opacity: 1; }
.rbx-kpi .s.down { color: var(--rbx-red); opacity: 1; }

.rbx-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.rbx-panel {
    border: 1px solid var(--rbx-line);
    background: var(--rbx-panel);
    border-radius: 18px;
    padding: 16px 18px 12px;
    min-width: 0;
}

.rbx-panel.wide { grid-column: 1 / -1; }

.rbx-panel h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.rbx-panel .rbx-sub {
    font-size: .76rem;
    opacity: .65;
    margin: 2px 0 8px;
}

.rbx-svg {
    display: block;
    max-width: 100%;
    overflow: visible;
    user-select: none;
}

.rbx-empty {
    padding: 38px 10px;
    text-align: center;
    font-size: .86rem;
    opacity: .6;
}

.rbx-tip {
    position: fixed;
    z-index: 99999;
    display: none;
    pointer-events: none;
    max-width: 270px;
    padding: 9px 12px;
    border-radius: 11px;
    background: rgba(14, 17, 22, .96);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .38);
    font-size: .78rem;
    line-height: 1.45;
}

.rbx-tip b {
    display: block;
    margin-bottom: 4px;
}

.rbx-tip .r {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.rbx-tip .d {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.rbx-donut {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: center;
}

.rbx-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1 1 170px;
    min-width: 0;
}

.rbx-legend li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: .84rem;
    border-bottom: 1px solid var(--rbx-soft);
}

.rbx-legend .d { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.rbx-legend .n { flex: 1; min-width: 0; }
.rbx-legend strong { font-variant-numeric: tabular-nums; font-weight: 600; font-size: .8rem; }

.rbx-frow {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
    align-items: baseline;
    padding: 7px 6px;
    border-radius: 8px;
    font-size: .86rem;
    cursor: default;
}

.rbx-frow:hover { background: var(--rbx-soft); }
.rbx-frow .track { grid-column: 1 / -1; grid-row: 2; height: 12px; border-radius: 7px; background: var(--rbx-soft); overflow: hidden; }
.rbx-frow .fill { height: 100%; width: 0; border-radius: 7px; transition: width .5s; }
.rbx-frow .num { text-align: right; font-variant-numeric: tabular-nums; }
.rbx-frow .drop { display: block; font-size: .72rem; color: var(--rbx-red); }

.rbx-note { font-size: .78rem; opacity: .7; margin: 10px 2px 0; }

@media (max-width: 760px) {
    .rbx-grid { grid-template-columns: 1fr; }
    .rbx-kpi .v { font-size: 1.45rem; }
}

html.theme-night .rbx-tip {
    background: rgba(243, 240, 234, .97);
    color: #0e1116;
    border-color: rgba(0, 0, 0, .16);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .25);
}

.rbx-panel .rbx-sub { text-transform: none; letter-spacing: normal; color: inherit; }
.rbx-today {
    border: 1px solid var(--rbx-line);
    background: var(--rbx-panel);
    border-radius: 16px;
    padding: 12px 16px;
    margin: 4px 0 12px;
}

.rbx-today-main {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 12px;
    font-size: 1.05rem;
    font-weight: 700;
}

.rbx-today-icon { font-size: 1.1rem; }
.rbx-today-time { font-variant-numeric: tabular-nums; color: var(--rbx-blue); }
.rbx-today-tz { font-size: .72rem; font-weight: 500; opacity: .6; text-transform: uppercase; letter-spacing: .08em; }
.rbx-today-reset { font-size: .78rem; opacity: .72; margin-top: 4px; }

.rbx-dates {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    padding: 12px 16px;
    margin: -4px 0 14px;
    border: 1px solid var(--rbx-line);
    background: var(--rbx-panel);
    border-radius: 14px;
    font-size: .85rem;
}

.rbx-dates[hidden] { display: none; }

.rbx-dates label { display: flex; align-items: center; gap: 8px; }

.rbx-date {
    font: inherit;
    font-size: .85rem;
    color: inherit;
    background: transparent;
    border: 1px solid var(--rbx-line);
    border-radius: 9px;
    padding: 6px 10px;
}

.rbx-apply {
    border: 0;
    background: var(--rbx-blue);
    color: #fff;
    font: inherit;
    font-size: .82rem;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 999px;
    cursor: pointer;
}

.rbx-apply:hover { filter: brightness(1.1); }
.rbx-dates-msg { color: var(--rbx-red); font-size: .8rem; }
.rbx-pulse {
    transform-box: fill-box;
    transform-origin: center;
    animation: rbxRing 1.8s ease-out infinite;
}

@keyframes rbxRing {
    0% { transform: scale(1); opacity: .55; }
    100% { transform: scale(3.2); opacity: 0; }
}
