:root {
    --outage-fault: #d7193f;
    --outage-restored: #0b83ba;
    --outage-planned: #e47f00;
    --outage-line: #d7e2ec;
    --outage-muted: #64748b;
    --outage-blue: #0f4c81;
}

.outage-page .notice {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    color: #7c2d12;
    margin-top: 10px;
    padding: 10px 12px;
}

.outage-info-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 10px;
}

.outages-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 10px;
    min-height: 680px;
}

.outages-map-panel,
.outages-side-panel {
    background: #fff;
    border: 1px solid var(--outage-line);
    border-radius: 8px;
    box-shadow: none;
}

.outages-map-panel {
    min-width: 0;
    overflow: hidden;
    position: relative;
}

#outagesMap {
    background: #aed8e2;
    height: 680px;
    width: 100%;
}

.outages-map-toolbar {
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(215, 226, 236, 0.96);
    border-radius: 8px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    left: 12px;
    max-width: calc(100% - 24px);
    padding: 9px 10px;
    position: absolute;
    right: 12px;
    top: 12px;
    z-index: 700;
}

.outages-map-toolbar strong {
    color: #0f2740;
    display: block;
    font-size: 14px;
}

.outages-map-toolbar span {
    color: var(--outage-muted);
    display: block;
    font-size: 12px;
    margin-top: 2px;
}

.outages-map-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.outages-map-actions .secondary-button {
    background: #e8f0f7;
    border: 1px solid #c7d7e6;
    border-radius: 999px;
    color: var(--outage-blue);
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    padding: 7px 10px;
}

.outages-map-actions .secondary-button.active {
    background: var(--outage-blue);
    color: #fff;
}

.outages-legend {
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(215, 226, 236, 0.96);
    border-radius: 8px;
    bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    left: 12px;
    padding: 9px 10px;
    position: absolute;
    z-index: 700;
}

.outages-legend span {
    align-items: center;
    color: #0f2740;
    display: inline-flex;
    font-size: 13px;
    font-weight: bold;
    gap: 6px;
}

.key {
    border-radius: 50%;
    display: inline-block;
    height: 12px;
    width: 12px;
}

.key.fault {
    background: var(--outage-fault);
}

.key.restored {
    background: var(--outage-restored);
}

.key.planned {
    background: var(--outage-planned);
}

.key.gust {
    background: #f97316;
}

.gust-legend-item {
    display: none !important;
}

.gust-layer-on .gust-legend-item {
    display: inline-flex !important;
}

.outages-side-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    padding: 14px;
}

.outages-summary h2 {
    color: #0f2740;
    font-size: 23px;
    margin: 0 0 4px;
}

.outages-summary p,
.outage-source-note {
    color: var(--outage-muted);
    font-size: 13px;
    line-height: 1.45;
    margin: 0;
}

.outages-stats-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 14px 0 8px;
}

.outages-stat {
    border: 1px solid var(--outage-line);
    border-radius: 8px;
    padding: 10px;
}

.outages-stat span {
    display: block;
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
}

.outages-stat small {
    color: var(--outage-muted);
    display: block;
    font-size: 12px;
    margin-top: 5px;
}

.fault-stat span {
    color: var(--outage-fault);
}

.premises-summary {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    color: #7c2d12;
    font-size: 13px;
    line-height: 1.35;
    margin: 0 0 14px;
    padding: 8px 10px;
}

.premises-summary strong {
    font-size: 14px;
}

.restored-stat span {
    color: var(--outage-restored);
}

.planned-stat span {
    color: var(--outage-planned);
}

.outages-filters,
.outage-layer-options {
    border: 0;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0 0 14px;
    padding: 0;
}

.outage-layer-options {
    grid-template-columns: 1fr;
}

.outages-filters legend,
.search-label {
    color: #314858;
    font-size: 13px;
    font-weight: bold;
    grid-column: 1 / -1;
    margin-bottom: 2px;
}

.outage-toggle {
    align-items: center;
    border: 1px solid var(--outage-line);
    border-radius: 999px;
    cursor: pointer;
    display: flex;
    font-size: 13px;
    justify-content: center;
    min-height: 38px;
    padding: 8px;
    text-align: center;
}

.outage-toggle input {
    clip: rect(0 0 0 0);
    height: 1px;
    overflow: hidden;
    position: absolute;
    width: 1px;
}

.outage-toggle.active {
    background: #edf7fc;
    border-color: #92c8e2;
    color: #0b5f8d;
    font-weight: bold;
}

.gust-toggle.active {
    background: #fff7ed;
    border-color: #fdba74;
    color: #9a3412;
}

.search-input {
    border: 1px solid var(--outage-line);
    border-radius: 8px;
    min-height: 42px;
    padding: 9px 11px;
    width: 100%;
}

.outages-list-head {
    align-items: center;
    border-top: 1px solid var(--outage-line);
    display: flex;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 12px;
}

.outages-list-head h3 {
    color: #0f2740;
    font-size: 15px;
    margin: 0;
}

.outages-list-head span {
    color: var(--outage-muted);
    font-size: 12px;
}

.outage-list {
    display: grid;
    flex: 1 1 auto;
    gap: 8px;
    margin-top: 10px;
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
}

.outage-card {
    background: #fbfdfe;
    border: 1px solid var(--outage-line);
    border-left: 5px solid var(--outage-blue);
    border-radius: 8px;
    cursor: pointer;
    display: grid;
    gap: 7px;
    padding: 10px;
    text-align: left;
    width: 100%;
}

.outage-card:hover,
.outage-card:focus,
.outage-card.selected {
    border-color: #93c9df;
    outline: none;
}

.outage-card.fault {
    border-left-color: var(--outage-fault);
}

.outage-card.restored {
    border-left-color: var(--outage-restored);
}

.outage-card.planned {
    border-left-color: var(--outage-planned);
}

.card-top {
    align-items: start;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.card-title {
    color: #0f2740;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
}

.badge {
    border-radius: 999px;
    color: #fff;
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 7px;
}

.badge.fault {
    background: var(--outage-fault);
}

.badge.restored {
    background: var(--outage-restored);
}

.badge.planned {
    background: var(--outage-planned);
}

.meta {
    color: var(--outage-muted);
    font-size: 12px;
    line-height: 1.4;
}

.outage-source-note {
    border-top: 1px solid var(--outage-line);
    margin-top: 12px;
    padding-top: 12px;
}

.marker-pin {
    align-items: center;
    border: 2px solid #fff;
    border-radius: 50% 50% 50% 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
    color: #fff;
    display: flex;
    font-size: 16px;
    font-weight: 900;
    height: 32px;
    justify-content: center;
    transform: rotate(-45deg);
    width: 32px;
}

.marker-pin span {
    transform: rotate(45deg);
}

.marker-pin.fault {
    background: var(--outage-fault);
}

.marker-pin.restored {
    background: var(--outage-restored);
}

.marker-pin.planned {
    background: var(--outage-planned);
}

.gust-dot {
    align-items: center;
    border: 2px solid #fff;
    border-radius: 999px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    color: #fff;
    display: flex;
    font-size: 12px;
    font-weight: 900;
    height: 30px;
    justify-content: center;
    opacity: 0.82;
    width: 30px;
}

.popup {
    min-width: 230px;
}

.popup h4 {
    font-size: 16px;
    margin: 0 0 7px;
}

.popup dl {
    display: grid;
    gap: 5px 10px;
    grid-template-columns: auto 1fr;
    margin: 0;
}

.popup dt {
    color: var(--outage-muted);
    font-weight: 700;
}

.popup dd {
    margin: 0;
}

.popup p {
    border-top: 1px solid var(--outage-line);
    font-size: 13px;
    line-height: 1.4;
    margin: 9px 0 0;
    padding-top: 9px;
}

.storm-mode .outages-shell {
    grid-template-columns: 1fr;
}

.storm-mode .outages-side-panel,
.storm-mode .outage-info-grid,
.storm-mode .site-footer {
    display: none;
}

.storm-mode #outagesMap {
    height: calc(100vh - 180px);
    min-height: 690px;
}

@media (max-width: 980px) {
    .outages-shell {
        grid-template-columns: 1fr;
    }

    #outagesMap {
        height: 620px;
    }

    .outages-side-panel {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .outages-map-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .outages-map-actions {
        justify-content: flex-start;
    }

    #outagesMap {
        height: 580px;
    }

    .outages-stats-grid,
    .outages-filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .outage-info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .outages-map-toolbar {
        left: 8px;
        right: 8px;
        top: 8px;
    }

    .outages-map-actions .secondary-button {
        flex: 1 1 auto;
        padding: 7px 8px;
    }

    .outages-legend {
        bottom: 8px;
        left: 8px;
        right: 8px;
    }

    .outages-stats-grid,
    .outages-filters {
        grid-template-columns: 1fr;
    }
}
