:root {
    --navy: #0a1e3a;
    --ink: #081845;
    --muted: #6076a8;
    --border: #dbe7f6;
    --surface: #ffffff;
    --page: #eaf3fb;
    --on: #0fd25b;
    --off: #ff4a4a;
    --switching: #ffc928;
    --blue: #0677f9;
}

* { box-sizing: border-box; }

body {
    min-height: 100vh;
    margin: 0;
    font-family: Inter, Arial, Helvetica, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 50% -20%, #174a80 0, transparent 42%),
        linear-gradient(180deg, #0c2b50 0, #d8eaf8 47%, #eaf6ff 100%);
}

header {
    padding: 28px 20px 16px;
    color: white;
    text-align: center;
}

header h1 {
    margin: 0 0 6px;
    font-size: clamp(2rem, 4vw, 2.625rem);
    line-height: 1;
}

header p {
    margin: 0;
    color: #d9e6f8;
    font-size: clamp(1rem, 2.2vw, 1.35rem);
}

.header-link {
    display: inline-flex;
    margin-top: 12px;
    padding: 8px 11px;
    border: 1px solid rgba(222, 240, 255, .42);
    border-radius: 9px;
    background: rgba(255, 255, 255, .08);
    color: #f1f8ff;
    font-size: .82rem;
    font-weight: 750;
    text-decoration: none;
}

.header-link:hover,
.header-link:focus-visible { background: rgba(255, 255, 255, .18); }

main {
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 20px 44px;
}

main h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

main p { line-height: 1.5; }

.back-to-regions {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    margin: 18px 0 0;
    color: #e8f3ff;
    font-size: 0.93rem;
    font-weight: 750;
    text-decoration: none;
}

.back-to-regions:hover,
.back-to-regions:focus-visible { color: #fff; text-decoration: underline; text-underline-offset: .18em; }

.region-page-intro {
    max-width: 900px;
    margin: 10px auto 18px;
    padding: 22px 24px;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 18px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 18px 40px rgba(5, 35, 68, .18);
}

.region-page-intro h2 { margin: 3px 0 5px; }
.region-page-intro > p:last-child { margin: 0; color: var(--muted); }
.region-page-eyebrow {
    margin: 0;
    color: #0b76cf;
    font-size: .73rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.region-section {
    max-width: 900px;
    margin: 28px auto;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 40px rgba(5, 35, 68, 0.18);
}

.region-section h2 { margin-top: 0; }
.section-description { color: var(--muted); }

.region-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.region-section-heading h2 { margin-bottom: 8px; }

.region-view-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 11px;
    border: 1px solid #bdd5ef;
    border-radius: 10px;
    background: #f6faff;
    color: #153d77;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 800;
    transition: .2s ease;
}

.region-view-toggle:hover,
.region-view-toggle:focus-visible {
    border-color: var(--blue);
    background: #e8f3ff;
    color: #075fc8;
}

.region-view-toggle[aria-pressed="true"] {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
}

.region-view-toggle-icon { font-size: 1.05rem; line-height: 1; }

.regions-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

/* The picker switches views through the HTML hidden attribute. Keep this
   explicit so the grid/map display rules can never make both visible. */
.regions-list[hidden],
.regions-map[hidden] {
    display: none !important;
}

/* Second region picker: the first selected map concept, kept separate from
   the original button list so users can switch between both presentations. */
.region-section.region-section-map-view {
    max-width: 1180px;
}

.regions-map {
    position: relative;
    isolation: isolate;
    display: grid;
    min-height: clamp(390px, 62vh, 660px);
    overflow: hidden;
    margin-top: 18px;
    padding: clamp(18px, 3vw, 34px);
    border: 1px solid #d1e1f1;
    border-radius: 16px;
    background:
        radial-gradient(circle at 15% 20%, rgba(72, 156, 255, .24), transparent 29rem),
        radial-gradient(circle at 88% 74%, rgba(255, 207, 63, .3), transparent 30rem),
        linear-gradient(135deg, #f7fbff 0%, #e6f1fb 56%, #fbfdff 100%);
}

.regions-map::before,
.regions-map::after {
    position: absolute;
    z-index: -1;
    width: min(40vw, 38rem);
    aspect-ratio: 1;
    border-radius: 50%;
    content: '';
    pointer-events: none;
}

.regions-map::before { top: -35%; left: -13%; background: rgba(49, 137, 239, .14); }
.regions-map::after { right: -15%; bottom: -45%; background: rgba(255, 205, 63, .18); }

.regions-map-copy {
    position: relative;
    z-index: 2;
    max-width: 420px;
    pointer-events: none;
}

.regions-map-copy p { margin: 0; color: #48647f; font-size: .9rem; }
.regions-map-eyebrow {
    margin-bottom: 4px !important;
    color: #0b76cf !important;
    font-size: .72rem !important;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.regions-map-canvas {
    display: grid;
    min-height: 0;
    place-items: center;
    width: min(100%, 1050px);
    margin: -8px auto 0;
}

.regions-map-canvas svg {
    width: 100%;
    max-height: min(52vh, 560px);
    overflow: visible;
}

.regions-map-region {
    fill: #b9d9f6;
    stroke: rgba(19, 85, 143, .62);
    stroke-linejoin: round;
    stroke-width: 1.2;
    vector-effect: non-scaling-stroke;
}

.regions-map-region[data-tone="1"] { fill: #b3d2f2; }
.regions-map-region[data-tone="2"] { fill: #c5e0f8; }
.regions-map-region[data-tone="3"] { fill: #a9ceef; }
.regions-map-region:not(.is-unavailable) {
    cursor: pointer;
    transform-box: fill-box;
    transform-origin: center;
    transition: fill .22s ease, stroke .22s ease, filter .22s ease, transform .22s ease;
}

.regions-map-region:not(.is-unavailable):hover,
.regions-map-region:not(.is-unavailable):focus-visible,
.regions-map-region.is-selected {
    fill: #f6c846;
    stroke: #8d5a00;
    filter: drop-shadow(0 9px 10px rgba(117, 78, 0, .22));
    outline: none;
    transform: translateY(-2px);
}

.regions-map-region.is-unavailable { fill: #dce8f2; stroke: rgba(74, 113, 146, .36); }

.regions-map-loading { color: #55718c; font-weight: 650; text-align: center; }

.regions-map-tooltip {
    position: fixed;
    z-index: 20;
    padding: 7px 10px;
    border-radius: 7px;
    background: #133657;
    box-shadow: 0 8px 22px rgba(5, 25, 45, .2);
    color: #fff;
    font-size: .76rem;
    font-weight: 700;
    pointer-events: none;
    transform: translate(12px, -110%);
}

.regions-map-status {
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    justify-self: center;
    max-width: 90%;
    margin: 0;
    padding: 10px 14px;
    border: 1px solid rgba(19, 77, 127, .12);
    border-radius: 999px;
    background: rgba(255, 255, 255, .77);
    box-shadow: 0 12px 40px rgba(38, 83, 127, .09);
    color: #42627f;
    font-size: .84rem;
    font-weight: 650;
    text-align: center;
}

.regions-map-status-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #1e94df;
    box-shadow: 0 0 0 4px rgba(30, 148, 223, .13);
}

.regions-map-attribution {
    position: absolute;
    right: 14px;
    bottom: 10px;
    margin: 0;
    color: #688097;
    font-size: .7rem;
}

.regions-map-attribution a { color: inherit; text-underline-offset: .15em; }

.region-card {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 5px 16px rgba(21, 58, 102, 0.07);
}

.region-card h3 { margin: 0 0 16px; font-size: 1.25rem; }
button { font: inherit; }

.region-card button,
.view-btn {
    cursor: pointer;
    transition: 0.2s ease;
}

.region-card button {
    padding: 11px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--blue);
    color: #fff;
    font-weight: 700;
}

.region-card button:hover,
.region-card button:focus-visible { background: #0567d6; }

.queue-section {
    max-width: 900px;
    margin: 0 auto 18px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 40px rgba(5, 35, 68, 0.18);
}

.queue-section[hidden] { display: none; }
.queue-section h2 { margin: 0 0 6px; }
.queue-description { margin: 0 0 18px; color: var(--muted); }

.schedule-notice {
    margin: -6px 0 20px;
    padding: 12px 14px;
    border: 1px solid #c8dcf5;
    border-radius: 10px;
    background: #f4f9ff;
    color: #34537e;
    font-size: 0.92rem;
    font-weight: 650;
}

.schedule-notice[hidden] { display: none; }

.address-search {
    margin: 20px 0;
    padding: 18px;
    border: 1px solid #c8dcf5;
    border-radius: 14px;
    background: linear-gradient(145deg, #f8fbff, #eaf4ff);
}

.address-search-heading h3 {
    margin: 0 0 4px;
    color: #0a194c;
    font-size: 1.12rem;
}

.address-search-heading p,
.address-search-status,
.queue-manual-label {
    margin: 0;
    color: #47618e;
    font-size: 0.9rem;
}

.address-fields {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.15fr) minmax(130px, 0.55fr);
    gap: 12px;
    margin-top: 15px;
}

.address-field {
    position: relative;
    display: grid;
    gap: 6px;
    color: #17366f;
    font-size: 0.82rem;
    font-weight: 800;
}

.address-field input {
    width: 100%;
    min-height: 45px;
    padding: 10px 12px;
    border: 1px solid #bcd2ed;
    border-radius: 9px;
    outline: none;
    background: #fff;
    color: #0a194c;
    font: inherit;
    font-weight: 600;
}

.address-field input::placeholder { color: #7890b6; }

.address-field input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(6, 119, 249, 0.14);
}

.address-field input:disabled {
    cursor: not-allowed;
    background: #e9f0f9;
    color: #7890b6;
}

.address-suggestions {
    position: absolute;
    z-index: 5;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    display: grid;
    max-height: 230px;
    overflow-y: auto;
    padding: 5px;
    border: 1px solid #b7cfed;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 24px rgba(14, 50, 98, 0.19);
}

.address-suggestions[hidden] { display: none; }

.address-suggestion {
    width: 100%;
    padding: 10px 11px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #13346c;
    cursor: pointer;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    text-align: left;
}

.address-suggestion:hover,
.address-suggestion:focus-visible { background: #e8f2ff; }

.address-search-status { margin-top: 13px; }

.address-search-status.success {
    color: #057238;
    font-weight: 800;
}

.address-queue-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.address-choice-button {
    padding: 9px 11px;
    border: 1px solid var(--blue);
    border-radius: 8px;
    background: #fff;
    color: #075fc8;
    cursor: pointer;
    font: inherit;
    font-size: 0.87rem;
    font-weight: 800;
}

.address-choice-button:hover,
.address-choice-button:focus-visible {
    background: var(--blue);
    color: #fff;
}

.queue-manual-label { margin: 20px 0 10px; font-weight: 800; }

.queues-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
    gap: 10px;
}

.queue-button {
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid #cbdcf0;
    border-radius: 10px;
    background: #f6faff;
    color: #17366f;
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s ease;
}

.queue-button:hover,
.queue-button:focus-visible {
    border-color: var(--blue);
    background: #e5f0ff;
}

.queue-button.active {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
    box-shadow: 0 4px 10px rgba(6, 119, 249, 0.25);
}

.schedule-section {
    margin-top: 12px;
    padding: 20px 24px 28px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 18px 42px rgba(5, 35, 68, 0.19);
}

.schedule-section[hidden] { display: none; }

.schedule-section h2 {
    margin: 2px 0 10px;
    text-align: center;
    color: var(--ink);
}

.schedule-day-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 13px;
    padding: 8px 10px;
    border: 1px solid #d8e6f5;
    border-radius: 13px;
    background: #f7fbff;
}

.schedule-day-switcher[hidden] { display: none; }

.schedule-day-label,
.tomorrow-schedule-status {
    color: #526f98;
    font-size: 0.82rem;
    font-weight: 700;
}

.tomorrow-schedule-status { min-height: 1em; }

.day-btn {
    min-width: 105px;
    padding: 9px 13px;
    border: 1px solid #ccdeef;
    border-radius: 9px;
    background: #fff;
    color: #1c4177;
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s ease;
}

.day-btn:hover:not(:disabled),
.day-btn:focus-visible:not(:disabled) {
    border-color: var(--blue);
    background: #e8f3ff;
}

.day-btn.active {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
    box-shadow: 0 4px 10px rgba(6, 119, 249, 0.22);
}

.day-btn:disabled {
    border-color: #e1e8f0;
    background: #f1f5f9;
    color: #91a1b7;
    cursor: not-allowed;
}

.schedule-switcher {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 16px;
}

.view-btn {
    min-width: 178px;
    padding: 13px 18px;
    border: 1px solid #d9e5f3;
    border-radius: 12px;
    background: #eef5fc;
    color: #193773;
    font-size: 1rem;
    font-weight: 800;
}

.view-btn:hover,
.view-btn:focus-visible { background: #dfeefa; }

.view-btn.active {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
    box-shadow: 0 4px 10px rgba(6, 119, 249, 0.28);
}

.schedule-details {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 22px;
    margin: 0 0 12px;
}

.schedule-details p {
    margin: 0;
    color: #47618e;
    font-size: 0.875rem;
}

#scheduleDateStatus.is-forecast {
    color: #93660b;
    font-weight: 800;
}

#scheduleDateStatus.is-stale {
    color: #9a4a12;
    font-weight: 800;
}

.schedule-legend {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin: 0 0 14px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #102e67;
    font-size: 0.84rem;
    font-weight: 700;
}

.legend-color {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--state-color);
    box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.1);
}

.legend-color.light-on, .on { --state-color: var(--on); }
.legend-color.light-off, .off { --state-color: var(--off); }
.legend-color.possible-outage, .switching { --state-color: var(--switching); }

.schedule-countdown {
    max-width: 420px;
    margin: 0 auto 16px;
    padding: 11px 14px;
    border: 1px solid #3adf81;
    border-radius: 12px;
    background: linear-gradient(135deg, #063d2a, #076b3f);
    color: white;
    font-size: 0.95rem;
    font-weight: 800;
    text-align: center;
}

.schedule-countdown[hidden] { display: none; }

.power-dial.is-forecast .dial-center {
    background: radial-gradient(circle at 50% 35%, #334155, #172033 75%);
}

.power-dial.is-forecast .dial-center-caption {
    color: #d9e7f7;
}

.circular-chart { display: grid; }

.circular-layout {
    display: grid;
    grid-template-columns: minmax(410px, 1.1fr) minmax(430px, 0.9fr);
    align-items: center;
    gap: 28px;
}

.power-dial {
    position: relative;
    width: min(100%, 570px);
    aspect-ratio: 1;
    filter: drop-shadow(0 10px 17px rgba(20, 58, 105, 0.19));
}

.dial-sectors {
    position: absolute;
    inset: 9%;
    border: 11px solid #fff;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(12, 46, 93, 0.2), 0 3px 12px rgba(9, 41, 82, 0.12);
}

.dial-hour-labels {
    position: absolute;
    inset: 0;
    color: #06144a;
    font-size: clamp(0.62rem, 1.9vw, 0.95rem);
    font-weight: 800;
}

.dial-hour-label {
    position: absolute;
    transform: translate(-50%, -50%);
}

.dial-hour-ticks {
    position: absolute;
    z-index: 1;
    inset: 0;
}

.dial-hour-tick {
    position: absolute;
    width: 2px;
    height: 10px;
    border-radius: 999px;
    background: #d6e5f5;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
}

.dial-hour-tick.major {
    width: 3px;
    height: 15px;
    background: #fff;
}

.dial-center {
    position: absolute;
    inset: 29%;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid #15375f;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 35%, #102a45, #051321 75%);
    box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.35);
    color: #fff;
    text-align: center;
}

.dial-center-caption { color: #c4d1e4; font-size: clamp(0.6rem, 1.8vw, 0.87rem); }
.dial-center strong { font-size: clamp(1.2rem, 5vw, 2.15rem); letter-spacing: 0.04em; }
.dial-center-status { max-width: 130px; color: #f4f9ff; font-size: clamp(0.6rem, 1.7vw, 0.82rem); font-weight: 800; line-height: 1.2; }

.clock-hand {
    position: absolute;
    z-index: 3;
    bottom: 50%;
    left: 50%;
    width: 5px;
    height: 38%;
    border-radius: 999px 999px 0 0;
    background: #1677e8;
    box-shadow: 0 1px 5px rgba(11, 82, 164, 0.45);
    transform: translateX(-50%);
    transform-origin: bottom center;
}

.clock-hand::after {
    position: absolute;
    bottom: -6px;
    left: 50%;
    width: 12px;
    height: 12px;
    border: 1px solid #e7f4ff;
    border-radius: 50%;
    background: #1677e8;
    box-shadow: 0 1px 5px rgba(11, 82, 164, 0.38);
    content: '';
    transform: translateX(-50%);
}

.circular-details {
    display: grid;
    gap: 16px;
}

.intervals-panel,
.info-panel {
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 5px 16px rgba(28, 68, 116, 0.08);
}

.intervals-panel h3,
.info-panel h3 {
    margin: 0 0 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    color: #0a194c;
    font-size: 1.08rem;
}

.circle-interval-list { display: grid; }

.circle-interval-row {
    display: grid;
    grid-template-columns: 20px 136px minmax(128px, 1fr) 86px;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid #e3ecf7;
    color: #19366f;
    font-size: 0.87rem;
}

.circle-interval-row:last-child { border-bottom: 0; }
.circle-interval-row strong { color: #0a194c; }

.interval-dot {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--state-color);
}

.circle-interval-duration { white-space: nowrap; color: #1a3974; }

.info-panel dl { display: grid; gap: 12px; margin: 0; }
.info-panel dl div { display: grid; gap: 2px; }
.info-panel dt { color: #6378a3; font-size: 0.78rem; }
.info-panel dd { margin: 0; color: #12326b; font-size: 0.9rem; font-weight: 800; }

.linear-chart {
    display: grid;
    gap: 26px;
    padding-top: 48px;
}

.linear-timeline {
    position: relative;
    padding: 0 0 28px;
}

.linear-timeline-blocks {
    display: flex;
    min-height: 78px;
    overflow: hidden;
    border: 1px solid #dce8f6;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(29, 72, 121, 0.08);
}

.timeline-block {
    display: grid;
    min-width: 0;
    place-items: center;
    padding: 8px 5px;
    border-right: 2px solid rgba(255, 255, 255, 0.8);
    background: var(--state-color);
    color: #071741;
    font-size: clamp(0.66rem, 1.55vw, 0.9rem);
    font-weight: 800;
    text-align: center;
}

.timeline-block small {
    font-size: 0.78em;
    font-weight: 700;
}

.timeline-block:last-child { border-right: 0; }
.timeline-block.off { color: #fff; }

.linear-current-marker {
    position: absolute;
    z-index: 2;
    top: -17px;
    bottom: 22px;
    width: 4px;
    border-radius: 999px;
    background: #0878f8;
    box-shadow: 0 0 0 2px #fff;
    transform: translateX(-50%);
}

.linear-current-marker::before {
    position: absolute;
    top: -8px;
    left: 50%;
    width: 0;
    height: 0;
    border: 7px solid transparent;
    border-top: 0;
    border-bottom-color: #0878f8;
    content: '';
    transform: translateX(-50%);
}

.linear-marker-label {
    position: absolute;
    top: -40px;
    left: 50%;
    padding: 4px 7px;
    border-radius: 7px;
    background: #0878f8;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    white-space: nowrap;
    transform: translateX(-50%);
}

.linear-time-axis {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    justify-content: space-between;
    color: #19366f;
    font-size: 0.78rem;
    font-weight: 700;
}

.linear-intervals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(154px, 1fr));
    gap: 10px;
}

.linear-interval {
    display: grid;
    gap: 5px;
    padding: 13px 14px;
    border-left: 7px solid var(--state-color);
    border-radius: 9px;
    background: #f6faff;
}

.linear-interval strong { color: #0a194c; font-size: 0.92rem; }
.linear-interval > span:not(.linear-status) { color: var(--muted); font-size: 0.8rem; }
.linear-status { color: #243e75; font-size: 0.8rem; font-weight: 800; }

@media (max-width: 720px) {
    main { padding: 0 12px 28px; }
    .region-section, .queue-section, .schedule-section { padding: 16px; border-radius: 15px; }
    .region-page-intro { padding: 16px; border-radius: 15px; }
    .regions-list { grid-template-columns: 1fr; }
    .region-section-heading { align-items: center; }
    .region-view-toggle { min-height: 36px; padding: 7px 9px; }
    .regions-map { min-height: 470px; padding: 18px 12px 36px; }
    .regions-map-canvas { margin-top: 6px; }
    .regions-map-canvas svg { max-height: 50vh; }
    .regions-map-status { max-width: 100%; padding: 9px 11px; font-size: .78rem; }
    .regions-map-attribution { right: 10px; bottom: 7px; font-size: .63rem; }
    .address-fields { grid-template-columns: 1fr; }
    .schedule-section h2 { text-align: left; }
    .schedule-switcher, .schedule-legend { justify-content: stretch; }
    .schedule-day-switcher { justify-content: flex-start; }
    .tomorrow-schedule-status { flex-basis: 100%; }
    .view-btn { flex: 1 1 150px; min-width: 0; padding: 11px 8px; font-size: 0.84rem; }
    .schedule-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .power-dial { width: min(100%, 500px); }
    .circular-layout { grid-template-columns: minmax(0, 1fr); }
    .circular-details { grid-template-columns: minmax(0, 1fr); }
    .linear-timeline-blocks { min-height: 66px; }
    .timeline-block { writing-mode: vertical-rl; transform: rotate(180deg); }
}

@media (max-width: 420px) {
    header { padding: 22px 12px 13px; }
    .schedule-details { justify-content: flex-start; }
    .region-section-heading { gap: 10px; }
    .region-view-toggle-icon { display: none; }
    .regions-map-copy p:last-child { font-size: .8rem; }
    .schedule-legend { grid-template-columns: 1fr; }
    .dial-sectors { border-width: 7px; }
    .circle-interval-row {
        grid-template-columns: 18px minmax(88px, 1fr) 72px;
        font-size: 0.76rem;
    }
    .circle-interval-row > span:not(.interval-dot):not(.circle-interval-duration) { display: none; }
    .linear-intervals { grid-template-columns: 1fr; }
}

/* Monitorix responsive linear timeline fix */
.timeline-block {
    container-type: inline-size;
}

/* Скрываем подписи только в блоках, где им тесно */
@container (max-width: 120px) {
    .timeline-block > span,
    .timeline-block > small {
        display: none;
    }
}

@media (max-width: 720px) {
    .linear-timeline-blocks {
        min-height: 42px;
    }

    .timeline-block {
        writing-mode: horizontal-tb;
        transform: none;
        padding: 0;
    }

    .timeline-block > span,
    .timeline-block > small {
        display: none;
    }
}

/* Monitorix universal linear labels toggle */
.linear-chart.linear-labels-available {
    padding-top: 12px;
}

.linear-labels-control {
    display: inline-flex;
    justify-self: end;
    align-items: center;
    gap: 9px;
    margin-bottom: 18px;
    padding: 7px 11px;
    border: 1px solid #dce8f6;
    border-radius: 9px;
    background: #f6faff;
    color: #19366f;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.linear-labels-control[hidden] {
    display: none !important;
}

.linear-labels-control input {
    accent-color: #0878f8;
    width: 17px;
    height: 17px;
    cursor: pointer;
}

.linear-chart .timeline-block {
    writing-mode: horizontal-tb;
    transform: none;
}

.linear-chart .timeline-block > span,
.linear-chart .timeline-block > small {
    display: none !important;
}

.linear-chart.linear-labels-on .timeline-block {
    min-height: 116px;
    padding: 0;
    overflow: hidden;
}

.linear-chart.linear-labels-on .timeline-block > span {
    display: block !important;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 11px;
    line-height: 12px;
    white-space: nowrap;
}

/* Monitorix responsive circular layout v2 */
.circular-chart {
    min-width: 0;
    container-type: inline-size;
}

.circular-layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: start;
    gap: clamp(16px, 2vw, 28px);
    min-width: 0;
}

.circular-layout > .power-dial {
    justify-self: center;
}

.circular-details,
.intervals-panel,
.info-panel {
    min-width: 0;
}

.intervals-panel {
    container-type: inline-size;
}

/* Переключаемся на вертикальную компоновку
   по фактической ширине графика */
@container (max-width: 1030px) {
    .circular-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .circular-layout > .power-dial {
        justify-self: center;
        width: min(100%, 520px);
    }

    .circular-details {
        width: 100%;
    }
}

/* Компактная таблица, когда ей недостаточно места */
@container (max-width: 420px) {
    .circle-interval-row {
        grid-template-columns: 18px minmax(0, 1fr) 74px;
        gap: 6px;
        font-size: 0.76rem;
    }

    .circle-interval-row > span:not(.interval-dot):not(.circle-interval-duration) {
        display: none;
    }
}
