.sld-page {
    --sld-background: #eef0f2;
    --sld-line: #172033;
    --sld-card: #78963e;
    --sld-card-stale: #b7791f;
    --sld-card-offline: #7b8794;
    --sld-header: #050505;
    --sld-border: #b8c2cc;
    padding: 1rem;
}

.sld-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.sld-page-title {
    margin: 0;
    color: #172033;
    font-size: 1.35rem;
    font-weight: 700;
}

.sld-page-subtitle {
    margin-top: 0.2rem;
    color: #667085;
    font-size: 0.82rem;
}

.sld-surface {
    overflow: auto;
    border: 1px solid var(--sld-border);
    border-radius: 0.5rem;
    background: var(--sld-background);
}

.sld-building {
    min-width: 1500px;
    padding: 2rem;
}

/* ==========================================================
   STANDARD ROWS
   ========================================================== */

.sld-row {
    display: grid;
    position: relative;
    align-items: center;
    gap: 1rem;
}

.sld-row-loads {
    grid-template-columns: repeat(12, minmax(100px, 1fr));
    min-height: 170px;
}

.sld-row-lv-bus {
    grid-template-columns: minmax(0, 1fr) 80px minmax(0, 1fr);
    min-height: 70px;
}

.sld-row-transformers {
    grid-template-columns: minmax(0, 1fr) 180px 240px 180px minmax(0, 1fr);
    min-height: 210px;
}

.sld-row-hv {
    grid-template-columns: 300px minmax(420px, 1fr) 80px minmax(420px, 1fr) 300px;
    min-height: 190px;
}

.sld-row-grid {
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    min-height: 150px;
}

/* ==========================================================
   STANDARD BUS
   ========================================================== */

.sld-bus-section {
    position: relative;
    min-height: 55px;
}

.sld-bus-line {
    position: absolute;
    top: 26px;
    right: 0;
    left: 0;
    height: 4px;
    background: var(--sld-line);
}

.sld-bus-end {
    position: absolute;
    top: 20px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--sld-line);
}

.sld-bus-end-left {
    left: -1px;
}

.sld-bus-end-right {
    right: -1px;
}

.sld-bus-name {
    position: absolute;
    top: 38px;
    left: 0;
    font-size: 0.8rem;
    font-weight: 700;
}

/* ==========================================================
   COUPLER
   ========================================================== */

.sld-coupler-component {
    display: grid;
    grid-template-columns: 1fr 30px 1fr;
    position: relative;
    align-items: center;
}

.sld-coupler-label {
    position: absolute;
    top: -25px;
    left: 50%;
    font-size: 0.68rem;
    white-space: nowrap;
    transform: translateX(-50%);
}

.sld-coupler-line {
    height: 4px;
    background: var(--sld-line);
}

.sld-coupler-symbol {
    width: 30px;
    height: 30px;
    border: 2px solid var(--sld-line);
    background: var(--sld-background);
}

/* ==========================================================
   VERTICAL CONNECTIONS
   ========================================================== */

.sld-drop {
    width: 2px;
    min-height: 45px;
    margin: 0 auto;
    background: var(--sld-line);
}

.sld-drop-long {
    min-height: 90px;
}

.sld-feeder-up {
    position: relative;
    width: 2px;
    min-height: 55px;
    margin: 0 auto;
    background: var(--sld-line);
}

    .sld-feeder-up::before {
        position: absolute;
        top: -10px;
        left: -5px;
        width: 0;
        height: 0;
        content: "";
        border-right: 6px solid transparent;
        border-bottom: 11px solid var(--sld-line);
        border-left: 6px solid transparent;
    }

/* ==========================================================
   TRANSFORMER
   ========================================================== */

.sld-transformer-component {
    display: flex;
    align-items: center;
    flex-direction: column;
    text-align: center;
}

.sld-transformer-name {
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    font-weight: 700;
}

.sld-transformer-symbol {
    position: relative;
    width: 44px;
    height: 70px;
}

.sld-transformer-coil {
    position: absolute;
    left: 4px;
    width: 36px;
    height: 36px;
    border: 2px solid var(--sld-line);
    border-radius: 50%;
    background: #9aa0a6;
}

    .sld-transformer-coil:first-child {
        top: 0;
    }

    .sld-transformer-coil:last-child {
        top: 29px;
    }

.sld-transformer-rating {
    display: flex;
    margin-top: 0.25rem;
    flex-direction: column;
    font-size: 0.68rem;
}

/* ==========================================================
   TELEMETRY CARDS
   ========================================================== */

.sld-meter-card {
    display: block;
    overflow: hidden;
    min-width: 110px;
    border: 1px solid var(--sld-line);
    background: var(--sld-card);
    color: #ffffff;
    font-size: 0.7rem;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

    .sld-meter-card:hover {
        color: #ffffff;
        text-decoration: none;
        filter: brightness(1.05);
    }

.sld-meter-card-header {
    display: flex;
    min-height: 27px;
    padding: 0.3rem 0.4rem;
    background: var(--sld-header);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    font-weight: 700;
    text-align: center;
}

    .sld-meter-card-header small {
        font-size: 0.62rem;
    }

.sld-meter-card-value {
    min-height: 20px;
    padding: 0.22rem 0.4rem;
    border-top: 1px solid rgba(17, 24, 39, 0.45);
    font-weight: 700;
    white-space: nowrap;
}

.sld-card-online {
    background: var(--sld-card);
}

.sld-card-stale {
    background: var(--sld-card-stale);
}

.sld-card-offline {
    background: var(--sld-card-offline);
}

/* ==========================================================
   STANDARD EQUIPMENT CELL
   ========================================================== */

.sld-equipment {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-direction: column;
}

.sld-equipment-label {
    margin-top: 0.3rem;
    font-size: 0.68rem;
    text-align: center;
}

/* ==========================================================
   RESPONSIVE BEHAVIOUR

   The SLD does not shrink. Smaller screens scroll horizontally.
   ========================================================== */

@media (max-width: 768px)
{
    .sld-page
    {
        padding: 0.5rem;
    }

    .sld-page-header
    {
        align-items: flex-start;
        flex-direction: column;
    }
}

    .sld-page-header {
        align-items: flex-start;
        flex-direction: column;
    }

