/* Frame around the charts of one subject — a chart on its own, or a device with its power and energy
   under one heading — and the sections inside it. A section keeps its plot area laid out while loading
   or empty, because ECharts needs a laid out element to initialise against. */

/* One legend for every chart below it, so a device keeps one colour and one switch across the pair.
   Sits on the sunken panel body rather than inside a card: it belongs to all of them. */
.looc-chart-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.5rem;
    margin-bottom: 0.875rem;
}

.looc-chart-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.55rem;
    background: var(--rz-base-background-color, #fff);
    border: 1px solid var(--rz-base-300, #e1e6ea);
    border-radius: 999px;
    font: inherit;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--rz-text-color, #2e3a45);
    cursor: pointer;
    transition: opacity 0.15s ease, border-color 0.15s ease;
}

.looc-chart-legend__item:hover {
    border-color: var(--rz-base-400, #cbd3da);
}

.looc-chart-legend__item:focus-visible {
    outline: 2px solid var(--rz-primary, #39b388);
    outline-offset: 1px;
}

/* Switched off: still readable, so the reader can find it again, but plainly not on the plot.
   The swatch empties out rather than greying, which would read as a fourth series colour. */
.looc-chart-legend__item.is-off {
    color: var(--rz-text-secondary-color, #5a6872);
    text-decoration: line-through;
}

.looc-chart-legend__item.is-off .looc-chart-legend__swatch {
    background: transparent !important;
    box-shadow: inset 0 0 0 1.5px var(--rz-base-400, #cbd3da);
}

.looc-chart-legend__swatch {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 0.1875rem;
    flex-shrink: 0;
}

.looc-chart-legend__reset {
    padding: 0.2rem 0.4rem;
    background: none;
    border: 0;
    font: inherit;
    font-size: 0.8125rem;
    color: var(--rz-primary, #39b388);
    cursor: pointer;
    text-decoration: underline;
}

.looc-chart-card {
    margin-bottom: 1.5rem;
}

.looc-chart-card__header {
    margin-bottom: 0.5rem;
}

.looc-chart-card__title {
    margin: 0;
    font-weight: 600;
}

/* A rule between the two plots of one device: they belong together, but they are not one chart. */
.looc-chart-section + .looc-chart-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--rz-border, #e5e9ec);
}

.looc-chart-section__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.25rem;
}

.looc-chart-section__heading {
    margin: 0;
    font-weight: 600;
}

.looc-chart-section__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* A remark rather than an alarm: old data is worth noticing, not worth shouting about. */
.looc-chart-section__notice {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    background: rgba(241, 87, 28, 0.1);
    color: #a8380f;
    font-size: 0.8125rem;
    white-space: nowrap;
}

/* Says something about the legend rather than about the installation, so it is set in grey: an
   explanation, not a warning. Declared after the base rule, which it overrides. */
.looc-chart-section__notice--muted {
    background: var(--rz-base-200, #eef1f4);
    color: var(--rz-text-secondary-color, #5a6872);
}

.looc-chart-section__body {
    position: relative;
}

.looc-chart-section__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.82);
    z-index: 1;
}

.looc-chart-section__overlay-text {
    color: var(--rz-text-secondary-color, #5a6872);
}
