/*
 * Public-site component styles — header/nav, buttons, cards, outage rows,
 * chips/tabs, map overlay, footer, subscribe modal. Design tokens and the
 * box-sizing/margin reset live in base.css (shared with admin-layout.php);
 * everything genuinely specific to the public site's look lives here.
 * Split out of layout.php's inline <style> block so it's cached by the
 * browser across page loads instead of re-downloaded/re-parsed on every
 * request.
 */

body {
    font-family: "Golos Text", "Golos Text Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
}

a { color: inherit; text-decoration: none; }

.shell {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 clamp(14px, 4vw, 32px);
}

/* header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.site-header-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    /* padding-top/-bottom only — same reasoning as .footer-inner below:
       the shorthand would zero .shell's horizontal padding. */
    padding-top: 9px;
    padding-bottom: 9px;
}

.brand { display: flex; align-items: center; gap: 10px; margin-right: 4px; }

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(150deg, #2E5BFF, #5b86ff);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(46, 91, 255, .28);
    flex-shrink: 0;
}

.brand-mark span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, .35);
}

.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -.2px; line-height: 1.1; }
.brand-sub { font-size: 11px; color: var(--muted-2); font-weight: 600; }

.city-switch { position: relative; }

.city-switch summary {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f0f2f6;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    padding: 8px 11px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    list-style: none;
}

.city-switch summary::-webkit-details-marker { display: none; }
.city-switch summary:hover { background: #e7eaf0; }

.city-switch summary .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.city-switch summary .arrow { color: var(--muted-3); font-size: 11px; }

.city-switch-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(20, 22, 28, .14);
    padding: 6px;
    min-width: 210px;
    z-index: 60;
    max-height: 320px;
    overflow: auto;
}

.city-switch-menu a {
    display: block;
    padding: 9px 11px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}

.city-switch-menu a:hover { background: #f2f4f8; }
.city-switch-menu a.is-active { color: var(--accent); }

.mainnav { display: flex; gap: 3px; flex-wrap: wrap; margin-left: auto; align-items: center; }

.mainnav a {
    padding: 8px 11px;
    border-radius: 9px;
    font-weight: 600;
    font-size: 14.5px;
    color: #3a4150;
}

.mainnav a:hover, .mainnav a.is-active { background: #f0f2f6; color: var(--text); }

/* Desktop-only "Ещё" dropdown (Карта/История/Аналитика/Блог/
   О сервисе). .nav-burger below (mobile hamburger, unchanged)
   duplicates all five links for narrow screens — kept exactly as
   it was, per explicit "mobile is already 100% right" feedback. */
.nav-more { position: relative; }

.nav-more-trigger {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 11px;
    border-radius: 9px;
    font-weight: 600;
    font-size: 14.5px;
    color: #3a4150;
    background: none;
    border: none;
}

.nav-more-trigger .arrow { font-size: 10px; color: var(--muted-3); }
.nav-more-trigger:hover { background: #f0f2f6; color: var(--text); }

.nav-more-menu {
    display: flex;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(20, 22, 28, .14);
    padding: 6px;
    min-width: 190px;
    z-index: 60;
    opacity: 0;
    visibility: hidden;
    /* visibility flips (and hit-testing/interactivity with it) only after
       the opacity fade finishes — gives the pointer ~100ms to reach the
       menu after leaving the trigger, instead of closing the instant
       :hover is lost, which was too fast to click a link inside it. */
    transition: opacity .1s linear, visibility 0s linear .1s;
}

.nav-more-menu a { padding: 9px 11px; border-radius: 8px; font-weight: 600; font-size: 14px; color: #3a4150; }
.nav-more-menu a:hover, .nav-more-menu a.is-active { background: #f2f4f8; color: var(--accent); }

/* Hover-driven, same as the user asked for ("при наведении") — not a
   <details>, deliberately: a closed <details>'s content is hidden by
   the browser's own UA stylesheet at a specificity a plain class
   selector can't reliably override (see [[nav_details_visibility_bug]]),
   and that mechanism doesn't fit a hover-triggered menu anyway.
   :focus-within is a minimal keyboard fallback (tab into the menu
   keeps it open) — no JS needed either way. */
.nav-more:hover .nav-more-menu, .nav-more:focus-within .nav-more-menu {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

.nav-burger { display: none; position: relative; }

.nav-burger summary {
    display: none;
    list-style: none;
    cursor: pointer;
}

.nav-burger summary::-webkit-details-marker { display: none; }

.nav-burger-panel { display: flex; gap: 3px; flex-wrap: wrap; align-items: center; }

.nav-burger-panel a {
    padding: 8px 11px;
    border-radius: 9px;
    font-weight: 600;
    font-size: 14.5px;
    color: #3a4150;
}

.nav-burger-panel a:hover, .nav-burger-panel a.is-active { background: #f0f2f6; color: var(--text); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 11px;
    padding: 12px 18px;
    font-weight: 700;
    font-size: 14.5px;
    cursor: pointer;
}

.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(46, 91, 255, .3); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: #f0f2f6; border: 1px solid var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: #e7eaf0; }
.btn-light { background: #fff; color: var(--accent-dark); }
.btn-light:hover { background: #eef2ff; }
.btn-block { width: 100%; padding: 15px; font-size: 16px; }

/* generic content blocks */
.page-section { max-width: 1140px; margin: 0 auto; padding: clamp(30px, 5vw, 54px) clamp(14px, 4vw, 32px); }
.page-section.tight-top { padding-top: 0; }
.page-section.bordered { background: #fff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.breadcrumbs { font-size: 13.5px; color: var(--muted-3); font-weight: 600; margin-bottom: 18px; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { margin: 0 7px; }
.breadcrumbs .current { color: var(--muted); }

h1 { font-weight: 800; letter-spacing: -.8px; margin: 0 0 14px; line-height: 1.08; }
h2 { font-weight: 800; letter-spacing: -.5px; margin: 0 0 6px; }
.section-title { font-size: clamp(20px, 3vw, 26px); }
.section-title-sm { font-size: clamp(18px, 2.6vw, 22px); }
/* Page H1 variants (were repeated inline on every template). */
.h1-page { font-size: clamp(26px, 4.6vw, 42px); max-width: 760px; }
.h1-doc { font-size: clamp(28px, 4.6vw, 42px); }
.section-sub { color: var(--muted-2); font-size: 15px; margin: 0 0 18px; }
.lede { font-size: clamp(16px, 2.2vw, 18px); line-height: 1.55; color: var(--muted); max-width: 660px; }

.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
/* Resource "по видам" tiles only (city.php/home.php) — 5 cards since hot
   water joined the primary resources; .cols-4's 210px floor needs >=1106px
   to fit 5 across but .page-section tops out at ~1076px, so the 5th always
   wrapped alone even on wide desktop. Kept as its own modifier rather than
   widening .cols-4, which two unrelated 4-card stat grids also use. */
.grid.cols-5 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
}

.card-link { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.card-link:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(20, 22, 28, .1); }

.icon-tile {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.icon-tile span { width: 16px; height: 16px; border-radius: 5px; }

.card-resource {
    overflow: hidden;
    background-repeat: no-repeat, no-repeat;
    background-position: center, bottom right;
    background-size: cover, 150px auto;
}

.outage-row {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 15px 17px;
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
    cursor: pointer;
    transition: box-shadow .15s, border-color .15s;
}

.outage-row:hover { box-shadow: 0 8px 20px rgba(20, 22, 28, .08); border-color: var(--border-strong); }
.outage-row.outage-row-multiday { border-left: 3px solid #f2a20c; }

/* /test/{city}/ draft only (UX audit 2026-07, П1 items 1-4) — one-line
   variant for the "Долгосрочные плановые" feed group, and the grouped-feed
   section headings/raw-source spoiler that go with it. */
.outage-row.outage-row-dense { padding: 10px 14px; gap: 10px; }
.outage-row.outage-row-dense .outage-title { font-size: 14px; }

.test-feed-group { margin-bottom: 28px; }
.test-feed-group-title { font-size: 16px; font-weight: 700; margin: 0 0 10px; }

.test-raw-source {
    background: #f7f8fa;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
}

.test-raw-source summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); list-style: none; }
.test-raw-source summary::-webkit-details-marker { display: none; }
.test-raw-source summary::before { content: '▸ '; }
.test-raw-source[open] summary::before { content: '▾ '; }
.test-raw-source-body { margin-top: 10px; font-size: 14px; line-height: 1.55; color: var(--muted); }
.test-raw-source-body p { margin: 0 0 10px; }
.test-raw-source-body p:last-child { margin-bottom: 0; }

/* /test/{city}/ bottom-sheet popup (UX audit 2026-07), reproducing
   .makets/historical/Список отключений.dc.html's shared modal — a distinct
   bottom-anchored sheet, deliberately not the live site's centered
   .modal-overlay/.modal-card. JS-toggled via .is-open (fetch-driven, not
   :target), so display:none -> flex is what (re)starts the child animations
   below on every open. */
@keyframes test-sheet-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes test-sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.test-sheet-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 150;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

.test-sheet-overlay.is-open { display: flex; }

.test-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 24, 30, .5);
    backdrop-filter: blur(3px);
    animation: test-sheet-fade .15s ease;
}

.test-sheet-card {
    position: relative;
    z-index: 1;
    background: #fff;
    width: 100%;
    max-width: 460px;
    max-height: 86vh;
    overflow-y: auto;
    border-radius: 18px 18px 0 0;
    padding: 20px 20px 26px;
    animation: test-sheet-up .22s cubic-bezier(.2, .7, .3, 1);
}

.test-sheet-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f1f3f5;
    color: var(--muted-2);
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.test-sheet-close:hover { background: #e7eaf0; }

.test-sheet-badges { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 44px 16px 0; }

.test-sheet-header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.test-sheet-title { font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.test-sheet-subtitle { font-size: 13.5px; color: var(--muted); margin-top: 2px; }

.test-sheet-meta { font-size: 14px; color: var(--muted); margin: 0 0 16px; }

.test-sheet-body { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }

.outage-icon { flex-shrink: 0; display: flex; }
.outage-main { flex: 1; min-width: 180px; }
.outage-title { font-weight: 700; font-size: 15.5px; }
.outage-reason { font-size: 13.5px; color: var(--muted-2); font-weight: 500; }
.outage-period { font-size: 13.5px; color: var(--muted); font-weight: 600; min-width: 120px; text-align: right; }

.chip-group { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; min-width: 120px; }

.chip {
    display: inline-flex;
    align-items: center;
    font-size: 12.5px;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 100px;
    white-space: nowrap;
}

.chip-date { background: #eef0f3; color: #565d6b; }
.chip-time { background: #eaf0ff; color: #2E5BFF; }
.chip-muted { background: #eef0f3; color: var(--muted-3); }

.detail-modal-section { margin: 0 0 12px; font-size: 14.5px; line-height: 1.5; }
.detail-modal-section:last-child { margin-bottom: 0; }
.detail-modal-label { font-weight: 700; color: var(--text); }

.provider-box { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #f7f8fa; border-radius: 12px; }
.provider-box .provider-name-line { flex: 1; font-size: 12px; color: var(--muted-2); }
.provider-box .provider-name { font-weight: 650; font-size: 14px; color: var(--text); }
.provider-box .provider-phone { font-weight: 700; font-size: 14px; white-space: nowrap; color: var(--accent); }
.provider-box .provider-phone:hover { color: var(--accent-dark); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 12.5px;
    padding: 5px 11px;
    border-radius: 100px;
}

.pill-list { display: flex; flex-wrap: wrap; gap: 9px; }

.pill {
    background: #f5f6f8;
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 9px 15px;
    font-weight: 600;
    font-size: 14px;
    color: #3a4150;
}

a.pill:hover { border-color: var(--accent); color: var(--accent); background: #f7f9ff; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14.5px; }
.table th { color: var(--muted-2); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }

.bar-track { height: 9px; background: #f0f2f6; border-radius: 100px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #2E5BFF, #5b86ff); border-radius: 100px; }

.search-panel {
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    padding: clamp(14px, 2.5vw, 18px);
    box-shadow: 0 10px 28px rgba(20, 22, 28, .07);
    max-width: 720px;
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.search-field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted-2); margin-bottom: 5px; }

.search-field input, .search-field .static-value {
    width: 100%;
    background: #f5f6f8;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 14.5px;
    font-family: inherit;
    font-weight: 600;
    color: var(--text);
}

.search-field input:focus { border-color: var(--accent); background: #fff; outline: none; }
.search-note { text-align: center; font-size: 13px; color: var(--muted-3); margin-top: 11px; }

/* Header's .city-switch reused verbatim inside a search field — just stretched
   to fill the grid column like the other fields, instead of the header's
   compact auto-width chip. */
.search-field .city-switch { width: 100%; }
.search-field .city-switch summary { width: 100%; justify-content: space-between; box-sizing: border-box; }

/* Portal search (test-index.php) — street field flexes, house field stays
   narrow rather than claiming an equal 1fr share like .search-grid's
   default auto-fit columns would otherwise give it. */
#portal-search-grid { grid-template-columns: minmax(160px, 2fr) minmax(90px, 1fr) auto auto; }
#portal-search-grid .search-field-street { min-width: 0; }

/* /portal draft only — mock address-suggestion dropdown, same visual
   language as .city-switch-menu (floating white card, shadow, hover row). */
.portal-suggest {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(20, 22, 28, .14);
    padding: 6px;
    z-index: 20;
}

.portal-suggest-item { padding: 10px 12px; border-radius: 8px; font-size: 14.5px; cursor: pointer; }
.portal-suggest-item:hover { background: #f2f4f8; }

/* /portal draft only — properties the 680px media query below needs to
   override. Kept out of the inline style="" in portal.php on purpose: an
   inline declaration always wins over an external stylesheet rule
   regardless of specificity, so anything a media query needs to change
   has to start out as a plain CSS rule, not inline. */
#portal-search-grid { grid-template-columns: 1fr auto auto; }
#portal-cities-header { align-items: baseline; }
#portal-city-filter { width: 220px; margin-left: auto; }
.portal-step-num { margin-bottom: 14px; }

/* /portal draft only — bottom subscribe CTA, built to match the mockup's
   dark 2-column card rather than the site's usual blue .cta-panel. Dark
   tone reuses --text (already the site's near-black) instead of a new hex.
   Grid-area layout (not just 2 flex columns) so the mobile breakpoint can
   reorder intro/buttons/steps/note into the mockup's mobile sequence
   without duplicating markup. */
.portal-cta {
    background: var(--text);
    border-radius: 16px;
    padding: clamp(26px, 4vw, 44px);
    color: #e8edf3;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    grid-template-areas:
        "intro   buttons"
        "steps   buttons"
        ".       note";
    column-gap: 36px;
    row-gap: 10px;
}

.portal-cta-intro { grid-area: intro; }
.portal-cta-buttons-wrap { grid-area: buttons; align-self: center; }
.portal-cta-steps { grid-area: steps; display: flex; gap: 18px; flex-wrap: wrap; font-size: 13.5px; color: #8fa1b3; align-self: start; }
.portal-cta-note { grid-area: note; font-size: 12px; color: #8fa1b3; }
.portal-cta-note a { color: #e8edf3; text-decoration: underline; }

.portal-cta h2 { font-size: clamp(21px, 3vw, 26px); margin: 0 0 10px; color: #fff; }
.portal-cta p { margin: 0; font-size: 15px; color: #b6c2cf; line-height: 1.5; }
.portal-cta-steps b { color: #e8edf3; }

.portal-cta-buttons { display: grid; gap: 12px; }

.portal-cta-btn {
    background: #fff;
    color: var(--text);
    border-radius: 10px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-cta-btn:hover { background: #e8edf3; color: var(--text); }
.portal-cta-icon { width: 34px; height: 34px; border-radius: 8px; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.portal-cta-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* /portal draft only — mobile fixes (2026-07-27): the "Проверить" button
   collapsing onto its own row is intentional here (matches the mockup's
   mobile layout exactly), just done in a controlled way instead of letting
   the desktop 3-column grid overflow/wrap unpredictably. Stats go 2-up.
   The city filter input and "3 steps" cards match the mockup's mobile
   arrangement (full-width input on its own row; number+text side by side).
   The CTA reorders to intro -> buttons -> steps -> note via grid-area. */
@media (max-width: 680px) {
    #portal-search-grid {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "field geo"
            "house house"
            "submit submit";
    }
    #portal-search-grid .search-field-street { grid-area: field; }
    #portal-search-grid .search-field-house { grid-area: house; }
    #portal-search-grid .portal-search-geo { grid-area: geo; }
    #portal-search-grid #portal-search-submit { grid-area: submit; width: 100%; }
    #portal-search .search-note { font-size: 11.5px; }

    /* Fit every resource on one line rather than wrapping — shrink gap/type
       a bit first, then allow horizontal scroll on just this row (not the
       page) as a fallback if it still doesn't quite fit. */
    #portal-resource-breakdown { flex-wrap: nowrap; overflow-x: auto; gap: 10px; font-size: 12.5px; max-width: 100%; }
    .portal-resource-chip { flex-shrink: 0; }

    #portal-stats-grid { grid-template-columns: 1fr 1fr; }

    #portal-cities-header { flex-direction: column; align-items: stretch; }
    #portal-city-filter { width: 100%; margin-left: 0; }

    .portal-step-card { display: flex; gap: 14px; align-items: flex-start; }
    .portal-step-card .portal-step-num { margin-bottom: 0; flex-shrink: 0; }

    .portal-cta {
        grid-template-columns: 1fr;
        grid-template-areas:
            "intro"
            "buttons"
            "steps"
            "note";
    }
    .portal-cta-steps { flex-direction: column; gap: 4px; }
}

.address-pending {
    background: #eef3ff;
    border: 1px solid #d6e2ff;
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 14.5px;
    color: #14213f;
}

/* street page — resource/status filter bar + "active now" block +
   month-divider history feed (see StreetPageQuery/PageController) */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }

.resource-tabs { display: flex; flex-wrap: wrap; gap: 2px; background: #eef0f3; border: 1px solid var(--border); border-radius: 11px; padding: 4px; }

.resource-tab {
    border: none;
    background: transparent;
    font-weight: 650;
    font-size: 13px;
    padding: 7px 13px;
    border-radius: 8px;
    color: #7a808a;
}

.resource-tab.is-active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.resource-tab.is-disabled { color: var(--muted-3); cursor: default; }
.resource-tab .tab-count { margin-left: 4px; font-size: 11px; font-weight: 700; opacity: .55; }

.status-chips { display: flex; gap: 6px; flex-wrap: wrap; }

.status-chip {
    border: 1px solid var(--border-strong);
    background: #fff;
    color: #5a6069;
    font-weight: 600;
    font-size: 12.5px;
    padding: 7px 13px;
    border-radius: 20px;
}

.status-chip.is-active { background: #16181d; color: #fff; border-color: #16181d; }

.active-block {
    background: linear-gradient(90deg, #fdecec, #fff6f6);
    border: 1px solid #f4d4d4;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.active-block-label { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #c93b3f; margin-bottom: 10px; }

.history-divider { font-size: 12px; font-weight: 700; color: var(--muted-2); letter-spacing: .03em; text-transform: uppercase; padding: 2px; }

/* City-page mini-map panel (resources/views/partials/mini-map.php, shared by
   the live city page and its /test/ sibling) — was inline-styled with a
   fixed flex-basis and no mobile override at all, so it never shrank on
   narrow viewports. */
.mini-map-panel { flex: 0 0 360px; min-width: 260px; position: relative; align-self: stretch; }

@media (max-width: 680px) {
    .mini-map-panel { flex: 1 1 100%; min-width: 0; }
}

/* Outage map — floating legend + count badge over the Yandex Maps
   canvas (see resources/views/pages/map.php). Layer/period/resource
   controls above the map reuse .resource-tabs/.resource-tab as-is. */
.map-legend {
    position: absolute;
    left: 14px;
    bottom: 14px;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(6px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 8px 24px -14px rgba(20, 24, 30, .4);
    max-width: 230px;
    z-index: 10;
}

.map-legend-title { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted-3); margin-bottom: 8px; }
.map-legend-items { display: flex; flex-direction: column; gap: 7px; }

.map-count-badge {
    position: absolute;
    right: 14px;
    top: 14px;
    background: rgba(20, 24, 30, .86);
    color: #fff;
    font-size: 12.5px;
    font-weight: 650;
    padding: 7px 13px;
    border-radius: 20px;
    box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .5);
    z-index: 10;
}

.cta-panel {
    background: linear-gradient(140deg, #1E3FB8, #2E5BFF 60%, #5b86ff);
    border-radius: 22px;
    padding: clamp(26px, 4vw, 44px);
    color: #fff;
    text-align: center;
}

.cta-panel.left { text-align: left; }
.cta-panel h2 { font-size: clamp(22px, 3.4vw, 30px); letter-spacing: -.6px; }
.cta-panel p { font-size: clamp(15px, 2vw, 17.5px); line-height: 1.55; color: rgba(255, 255, 255, .88); margin: 0 auto 22px; max-width: 520px; }
.cta-panel.left p { margin: 0 0 24px; }
.cta-buttons { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.cta-note { text-align: center; font-size: 12.5px; color: rgba(255, 255, 255, .72); margin-top: 16px; line-height: 1.5; }
.cta-note a { color: #fff; text-decoration: underline; }
.cta-panel.left .cta-buttons { justify-content: flex-start; }

footer.site-footer { background: #14161c; color: #c4c9d2; margin-top: 40px; }
/* padding-top/-bottom only (not the shorthand) — the shorthand would zero
   out left/right and silently override .shell's horizontal padding, since
   this rule comes later in the cascade at equal specificity. That's what
   was pinning footer text to the viewport edge on mobile (2026-07-28). */
.footer-inner { padding-top: clamp(34px, 5vw, 56px); padding-bottom: clamp(24px, 4vw, 36px); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: clamp(24px, 4vw, 44px); margin-bottom: 36px; }
.footer-col-title { font-weight: 700; font-size: 14px; color: #fff; margin-bottom: 14px; }
.footer-links { display: grid; gap: 9px; font-size: 13.5px; }
.footer-links a { color: #c4c9d2; }
.footer-links a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #262a33; padding-top: 20px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: #8b919c; }
.footer-legal-links { display: flex; gap: 14px; flex-wrap: wrap; }
.footer-legal-links a { color: #9aa0ab; }
.footer-legal-links a:hover { color: #fff; }

.muted { color: var(--muted); }
.stack > * + * { margin-top: 16px; }

/* subscribe modal — CSS-only, driven by :target, works without JS */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease;
}

.modal-overlay:target { opacity: 1; visibility: visible; pointer-events: auto; }

/* A separate full-bleed link behind the card (not a card ancestor) —
   clicking it closes the modal, clicking the card itself never
   reaches it since the card paints on top. No JS needed. */
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 14, 20, .55);
    backdrop-filter: blur(4px);
    z-index: 1;
}

/* Outer shell clips to the rounded corners and never scrolls itself —
   .modal-card-body is the only scrolling element, so its scrollbar
   renders inset within the rounded shell instead of poking outside
   it, and .modal-close (a sibling, not part of the scroll area)
   stays pinned to the card's own corner regardless of scroll. */
.modal-card {
    position: relative;
    z-index: 2;
    background: #fff;
    border-radius: 22px;
    max-width: 440px;
    width: 100%;
    max-height: calc(100vh - 32px);
    box-shadow: 0 30px 70px rgba(0, 0, 0, .35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-right: 6px;
}

.modal-card-body {
    overflow-y: auto;
    padding: clamp(22px, 4vw, 30px);
    padding-right: calc(clamp(22px, 4vw, 30px) - 6px);
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 17px;
    color: var(--muted-2);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(20, 22, 28, .15);
}

.modal-close:hover { background: #e7eaf0; }

.modal-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(150deg, #2E5BFF, #5b86ff);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.modal-icon span { width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 5px rgba(255, 255, 255, .3); }

.modal-card h2 { font-size: 24px; margin: 0 0 8px; }
.modal-card .lede { max-width: none; margin: 0 0 20px; }

.subscribe-options { display: grid; gap: 11px; }

.subscribe-option { display: flex; align-items: center; gap: 13px; border-radius: 13px; padding: 15px 18px; }
.subscribe-option.max { background: var(--accent); color: #fff; }
.subscribe-option.max:hover { background: var(--accent-dark); color: #fff; }
.subscribe-option.telegram { background: #fff; border: 1.5px solid var(--border-strong); color: var(--text); }
.subscribe-option.telegram:hover { border-color: #229ED9; background: #f5fbfe; }

.subscribe-option-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 17px;
    flex-shrink: 0;
    overflow: hidden;
}

.subscribe-option-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }

.subscribe-option-body { flex: 1; }
.subscribe-option-title { font-weight: 800; font-size: 16px; display: block; }
.subscribe-option-sub { font-size: 12.5px; }
.subscribe-option.max .subscribe-option-sub { color: rgba(255, 255, 255, .8); }
.subscribe-option.telegram .subscribe-option-sub { color: var(--muted-2); }

.subscribe-note { text-align: center; font-size: 12.5px; color: var(--muted-3); margin-top: 16px; line-height: 1.5; }
.subscribe-note a { color: var(--accent); text-decoration: underline; }

/* /portal draft only — .site-header is position:sticky, so jumping to an
   in-page anchor (header/burger "Подписаться" -> #subscribe, "Как это
   работает" -> #how) would otherwise land the target heading right under
   the fixed header. scroll-margin-top reserves that space up front. */
#how, #cities, #subscribe { scroll-margin-top: 84px; }

@media (max-width: 900px) {
    .site-header-inner { padding-top: 12px; padding-bottom: 12px; }
    .grid.cols-2 { grid-template-columns: 1fr; }

    /* Subscribing is still reachable from every page's own CTA
       section and the footer — the header button just isn't worth
       the space it takes up alongside the burger on narrow screens. */
    .header-subscribe-btn { display: none; }

    /* Portal's mockup keeps "Подписаться" in the header even on mobile (it
       just jumps to the on-page #subscribe CTA), and collapses ALL nav
       items — including "Города" — behind the burger, not just the
       secondary ones header.php hides. */
    .portal-header .mainnav { display: none; }
    /* margin-left:auto pushes this button (and the burger right after it,
       following normally in flow) to the right edge as a group, now that
       .mainnav — which normally carries that auto margin — is hidden. */
    .portal-header .header-subscribe-btn { display: inline-flex; margin-left: auto; }

    .nav-more { display: none; }
    .nav-burger { display: block; }

    /* 5 resources don't fit .mainnav on one mobile row anymore (was 4) —
       drop the last one (Газ); same breakpoint the burger above appears
       on, which carries a duplicate link for it (see nav-burger-panel in
       header.php), so it's never missing from both places at once. */
    .mainnav a[data-resource="gas"] { display: none; }

    /* Desktop's margin-left:auto pushes .mainnav flush right against
       .nav-more/the subscribe button — with those gone on mobile it just
       pushed .mainnav (and its content) straight off the right edge of the
       viewport instead, with .nav-burger never getting any room at all.
       Left-aligned, .mainnav starts right where .nav-burger can follow it
       on the same row (confirmed live: fits from ~390px up already this
       way alone). Slightly tighter link padding/font closes the remaining
       gap at the narrowest common phone widths (360-375px), where burger
       was still getting clipped at the right edge. */
    .mainnav { margin-left: 0; }
    .mainnav a { padding: 7px 8px; font-size: 13.5px; }

    /* The floating legend eats too much of an already-small mobile
       map canvas — hidden there, the layer/period/resource controls
       above the map are still fully available. */
    .map-legend { display: none; }

    .nav-burger summary {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 10px;
        background: #f0f2f6;
        border: 1px solid var(--border-strong);
        font-size: 18px;
        color: var(--text);
    }

    .nav-burger summary:hover { background: #e7eaf0; }

    .nav-burger-panel {
        display: none;
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 12px;
        box-shadow: 0 16px 40px rgba(20, 22, 28, .14);
        padding: 6px;
        min-width: 200px;
        z-index: 60;
    }

    .nav-burger[open] .nav-burger-panel { display: flex; }
    .nav-burger-panel a { padding: 9px 11px; border-radius: 8px; }
}

/* Portal header on very narrow screens: brand + "Подписаться" + burger no
   longer all fit on one row. Drop the subscribe button rather than let the
   burger wrap to a second line — it's still reachable from the on-page CTA
   and the burger panel doesn't lose anything (this button was always just a
   shortcut to #subscribe, not a distinct destination). */
@media (max-width: 420px) {
    .portal-header .header-subscribe-btn { display: none; }
    /* With the subscribe button gone, the burger is the last visible item
       and needs its own auto margin to stay pinned right — declaring this
       alongside a still-visible .header-subscribe-btn's margin-left:auto
       (as in the 900px block above) would instead split the free space
       between both, pushing them apart instead of keeping them flush. */
    .portal-header .nav-burger { margin-left: auto; }
}

/* /terms/, /privacy/ — long numbered legal documents (terms.php/privacy.php).
   Adapted from the source .html drafts' own typographic system, but on this
   site's tokens (--accent/--text/--muted-3/--border) instead of a separate
   palette, and scoped under .legal-doc so it can't leak into any other
   page's h2/table/ul styling. */
.legal-doc-meta { color: var(--muted-3); font-size: 13.5px; margin: 0 0 28px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.legal-doc { max-width: 720px; }
.legal-doc h2 { font-size: 17px; font-weight: 700; margin: 2.2rem 0 .75rem; line-height: 1.35; }
.legal-doc h2 .num { color: var(--muted-3); font-weight: 400; margin-right: .5rem; }
.legal-doc h3 { font-size: 15px; font-weight: 700; margin: 1.6rem 0 .5rem; }
.legal-doc p { margin: 0 0 1rem; font-size: 15px; line-height: 1.65; }
.legal-doc ul, .legal-doc ol { margin: 0 0 1rem; padding-left: 1.3rem; font-size: 15px; line-height: 1.65; }
.legal-doc li { margin-bottom: .4rem; }
.legal-doc a { color: var(--accent); }
.legal-doc .callout { border-left: 3px solid var(--accent); background: #f4f8fb; padding: 1rem 1.25rem; margin: 1.25rem 0; }
.legal-doc .callout p:last-child { margin-bottom: 0; }
.legal-doc-req { border: 1px solid var(--border); border-radius: 10px; padding: 1.2rem 1.5rem; margin: 1.25rem 0; }
.legal-doc-req dl { margin: 0; display: grid; grid-template-columns: 12rem 1fr; gap: .4rem 1rem; }
.legal-doc-req dt { color: var(--muted-3); font-size: 14px; }
.legal-doc-req dd { margin: 0; font-size: 14.5px; }
.legal-doc table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: 14.5px; }
.legal-doc th, .legal-doc td { text-align: left; vertical-align: top; padding: .6rem .75rem; border-bottom: 1px solid var(--border); }
.legal-doc th { font-weight: 700; background: #f6f8fa; }

@media (max-width: 560px) {
    .legal-doc-req dl { grid-template-columns: 1fr; gap: .15rem; }
    .legal-doc-req dt { font-size: 12.5px; }
    .legal-doc-req dd { margin-bottom: .6rem; }
    .legal-doc table, .legal-doc thead, .legal-doc tbody, .legal-doc tr, .legal-doc th, .legal-doc td { display: block; }
    .legal-doc th { display: none; }
    .legal-doc td { border: none; padding: .15rem 0; }
    .legal-doc tr { border-bottom: 1px solid var(--border); padding: .75rem 0; display: block; }
    .legal-doc td:first-child { font-weight: 700; }
}

/*
 * Outage page (/{city}/outage/{id}/, resources/views/pages/outage.php) —
 * redesign per the spec in .makets ("Страница отключения — спецификация.md").
 * Tokens are the spec's own, scoped to .op so the rest of the site is
 * untouched. Layout is fluid: two columns appear as soon as both fit
 * (flex-wrap), and below 720px the cards of both columns interleave into
 * the mobile order (display: contents + order).
 */
.op {
    --op-card: #fff;
    --op-line: #E6E9F0;
    --op-line-strong: #DDE1EA;
    --op-soft: #F6F8FB;
    --op-text: #12141A;
    --op-text-2: #4B5263;
    --op-text-3: #6B7280;
    --op-accent: #2A5BFF;
    --op-accent-hover: #1A43D6;
    --op-accent-light: #E9EEFF;
    color: var(--op-text);
}

.op-shell { padding-top: 20px; padding-bottom: 56px; display: flex; flex-direction: column; gap: 20px; }
.op h1, .op h2, .op p, .op ul, .op dl, .op dd, .op blockquote { margin: 0; }
.op h2 { font-size: 20px; font-weight: 800; letter-spacing: -.01em; line-height: 1.25; }

.op-crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; font-weight: 600; color: var(--op-text-3); }
.op-crumbs a:hover { color: var(--op-accent); }
.op-crumbs-current { color: #1F2430; }

.op-hero, .op-body { display: flex; flex-wrap: wrap; gap: 20px; }
.op-hero { align-items: flex-start; }
.op-body { align-items: flex-start; }
.op-hero-main, .op-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
.op-hero-main { gap: 14px; }
.op-main, .op-aside { gap: 20px; }
.op-status, .op-aside { flex: 1 1 340px; min-width: 0; }
.op-aside { display: flex; flex-direction: column; }

.op-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.op-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; background: #EEF1F6; color: var(--op-text-2); }
.op-badge-emergency { background: #FDE8E8; color: #B42318; }
.op-badge-state-planned, .op-badge-resource { background: var(--op-accent-light); color: var(--op-accent-hover); }
.op-badge-state-active { background: #FEF3C7; color: #92400E; }
.op-badge-state-overdue { background: #FFEDD5; color: #9A3412; }
.op-badge-dot { width: 7px; height: 7px; border-radius: 50%; background: #D97706; }

.op-title { display: flex; align-items: center; gap: 14px; }
.op-title-icon { width: 52px; height: 52px; flex-shrink: 0; border-radius: 16px; display: flex; align-items: center; justify-content: center; }
.op-title h1 { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.1; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.op-lead { font-size: 17px; line-height: 1.5; color: var(--op-text-2); }

.op-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.op-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font-family: inherit; font-size: 15px; font-weight: 700; line-height: 1; cursor: pointer; }
.op-btn-primary { background: var(--op-accent); color: #fff; }
.op-btn-primary:hover { background: var(--op-accent-hover); }
.op-btn-outline { background: #fff; border-color: var(--op-line-strong); color: var(--op-text); }
.op-btn-outline:hover { border-color: var(--op-accent); color: var(--op-accent); }
.op-btn-small { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--op-line-strong); background: #fff; font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1; color: var(--op-text-2); cursor: pointer; }
.op-btn-small:hover { border-color: var(--op-accent); color: var(--op-accent); }

.op-card { background: var(--op-card); border: 1px solid var(--op-line); border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.op-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.op-kicker { font-size: 13px; font-weight: 700; color: var(--op-text-3); text-transform: uppercase; letter-spacing: .04em; }
.op-count { color: var(--op-text-3); font-weight: 600; }

.op-status { box-shadow: 0 8px 24px rgba(18, 20, 26, .05); }
.op-status-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.op-status-checked { font-size: 13px; color: var(--op-text-3); }
.op-status-caption { font-size: 15px; font-weight: 600; color: var(--op-text-2); }
.op-status-big { font-size: clamp(36px, 4vw, 44px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.op-status-when { margin-top: 6px; font-size: 15px; font-weight: 600; color: var(--op-text-2); }
.op-status-note, .op-status-message { padding: 12px 14px; border-radius: 12px; background: var(--op-soft); font-size: 14px; line-height: 1.45; color: var(--op-text-2); }
.op-status-message { padding: 16px; border-radius: 14px; display: flex; flex-direction: column; gap: 6px; }
.op-status-title { font-size: 19px; font-weight: 800; line-height: 1.3; color: var(--op-text); }
.op-status-overdue .op-status-message { background: #FFF7ED; }
.op-status-was { font-weight: 700; color: var(--op-text); }
.op-progress { display: flex; flex-direction: column; gap: 8px; }
.op-progress-track { height: 10px; border-radius: 999px; background: #EEF1F6; overflow: hidden; }
.op-progress-fill { height: 100%; border-radius: 999px; background: var(--op-accent); }
.op-progress-labels { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 700; }
.op-progress-now { color: var(--op-accent); }

.op-facts-card { padding: 0; overflow: hidden; }
/* Flex, not grid: cells of an incomplete last row stretch, so a hidden fact never leaves a hole. */
.op-facts { display: flex; flex-wrap: wrap; }
.op-fact { flex: 1 1 30%; padding: 18px 20px; margin: -1px 0 0 -1px; border-top: 1px solid var(--op-line); border-left: 1px solid var(--op-line); min-width: 0; }
.op-fact-wide { flex-basis: 100%; }
.op-fact dt { font-size: 13px; font-weight: 600; color: var(--op-text-3); }
.op-fact dd { margin-top: 4px; font-size: 17px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.op-fact-wide dd { font-size: 15px; font-weight: 600; }
.op-fact dd a { color: var(--op-accent); }
.op-fact dd a:hover { color: var(--op-accent-hover); }
.op-tone-emergency { color: #B42318; }

.op-streets { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.op-streets li { max-width: 100%; }
.op-street { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 44px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--op-line); background: var(--op-soft); font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--op-text); }
.op-street svg { flex-shrink: 0; color: var(--op-text-3); }
.op-street-houses { font-weight: 500; color: var(--op-text-3); overflow-wrap: anywhere; }
a.op-street:hover { border-color: var(--op-accent); background: #F7F9FF; }
a.op-street:hover .op-street-name, a.op-street:hover svg { color: var(--op-accent); }
.op-more summary { cursor: pointer; font-size: 14px; font-weight: 700; color: var(--op-accent); min-height: 44px; display: flex; align-items: center; list-style: none; }
.op-more summary::-webkit-details-marker { display: none; }
.op-more[open] summary { display: none; }

.op-source { gap: 12px; }
.op-source blockquote { padding: 14px 16px; border-radius: 12px; background: var(--op-soft); font-size: 15px; line-height: 1.55; color: #1F2430; overflow-wrap: anywhere; }
.op-source blockquote p + p { margin-top: 8px; }
.op-source-title { font-weight: 700; }
.op-source-meta { font-size: 13px; color: var(--op-text-3); }

.op-provider { gap: 14px; }
.op-provider-name { font-size: 18px; font-weight: 800; line-height: 1.3; }
.op-provider-phone { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 6px 14px; border-radius: 12px; background: var(--op-accent-light); color: var(--op-accent-hover); font-size: 17px; font-weight: 800; text-align: center; }
.op-provider-phone:hover { background: #DCE5FF; }
.op-provider-note { font-size: 13px; line-height: 1.5; color: var(--op-text-3); overflow-wrap: anywhere; }

.op-subscribe { background: #12141A; border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 12px; color: #fff; }
.op-subscribe h2 { font-size: 18px; }
.op-subscribe p { font-size: 14px; line-height: 1.45; color: #C4C9D4; }
.op-subscribe-btn { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 12px; font-weight: 700; }
.op-subscribe-tg { background: var(--op-accent); color: #fff; }
.op-subscribe-tg:hover { background: var(--op-accent-hover); }
.op-subscribe-max { background: #fff; color: var(--op-text); }
.op-subscribe-max:hover { background: #EEF1F6; }
.op-subscribe-note { font-size: 12px; line-height: 1.45; color: #9AA1AE; }
.op-subscribe-note a { text-decoration: underline; }

.op-tips { gap: 10px; }
.op-tips h2 { font-size: 17px; }
.op-tips ul { padding-left: 18px; font-size: 14px; line-height: 1.6; color: var(--op-text-2); }

/* Status card extras: elapsed line under a countdown, more-than-a-day alert. */
.op-status-elapsed { font-size: 15px; font-weight: 700; color: var(--op-text); }
.op-status-alert { padding: 12px 14px; border-radius: 12px; background: #FFF7ED; color: #9A3412; font-size: 14px; font-weight: 600; line-height: 1.45; }

/* Scale: outages going on now around this one. */
.op-scale { font-size: 16px; font-weight: 600; line-height: 1.45; color: var(--op-text-2); }
.op-scale-title { font-size: 15px; margin-top: 4px; }
.op-scale-districts { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.op-scale-districts li { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--op-line); background: #fff; font-size: 15px; }
.op-scale-districts a { font-weight: 700; color: var(--op-accent); }

/* FAQ (visible <details>, no FAQPage markup). */
.op-faq { gap: 4px; }
.op-faq h2 { margin-bottom: 8px; }
.op-faq-item { border-top: 1px solid var(--op-line); }
.op-faq-item summary { min-height: 48px; display: flex; align-items: center; padding: 10px 0; font-weight: 700; line-height: 1.35; cursor: pointer; }
.op-faq-item p { padding: 0 0 14px; font-size: 15px; line-height: 1.55; color: var(--op-text-2); }

/* "Reportá el corte" (partials/report-block.php): outage page and district page,
   so no --op-* variables here. */
.report { background: #fff; border: 1px solid #E3E7EE; border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 12px; color: #12141A; }
.report-title { font-size: 18px; font-weight: 800; line-height: 1.3; }
.report-intro { font-size: 14px; line-height: 1.5; color: #4A5060; }
.report-company { display: flex; flex-direction: column; gap: 10px; }
.report-company + .report-company { padding-top: 12px; border-top: 1px solid #EEF1F6; }
.report-company-name { font-size: 16px; font-weight: 800; }
.report-actions { display: flex; flex-direction: column; gap: 8px; }
.report-btn { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px; border-radius: 12px; font-size: 15px; font-weight: 600; line-height: 1.3; }
.report-btn svg { flex-shrink: 0; }
.report-btn strong { font-weight: 800; white-space: nowrap; }
.report-call { background: #2A5BFF; color: #fff; }
.report-call:hover { background: #1E46D6; }
.report-wa { background: #E7F8EE; color: #116B3A; }
.report-wa:hover { background: #D3F1DF; }
.report-more { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; line-height: 1.5; color: #4A5060; }
.report-more a, .report-regulator a, .report-verified a { color: #2A5BFF; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.report-note { font-size: 13px; line-height: 1.5; color: #6B7280; overflow-wrap: anywhere; }
.report-tip { padding: 10px 12px; border-radius: 12px; background: #F5F7FA; font-size: 14px; font-weight: 600; line-height: 1.45; }
.report-regulator { display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.5; color: #4A5060; }
.report-verified { font-size: 12px; line-height: 1.45; color: #6B7280; }
.report-verified a { font-weight: 400; color: inherit; }
/* District page: full content width like the feed and the map; text keeps a readable line,
   call buttons sit side by side instead of stretching across the card. */
.report-district .report-intro, .report-district .report-regulator, .report-district .report-tip { max-width: 75ch; }
.report-district .report-tip { align-self: flex-start; }
@media (min-width: 720px) {
    .report-district .report-actions { flex-direction: row; flex-wrap: wrap; }
    .report-district .report-btn { flex: 0 1 auto; }
}
.report p, .report h2, .report h3, .report ul { margin: 0; }

/* District statistics, questions and "Barrios cercanos" (seo task 1.1, 1.3); district and outage pages. */
.dstats { background: #fff; border: 1px solid #E3E7EE; border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.dstats-last, .dstats-note { max-width: 75ch; }
.dstats h2, .dstats h3, .dstats p, .dstats dl { margin: 0; }
.dstats-label { font-size: 15px; font-weight: 800; color: #4A5060; }
.dstats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 8px !important; }
.dstats-item { padding: 12px 14px; border-radius: 12px; background: #F5F7FA; }
.dstats-item dt { font-size: 13px; font-weight: 600; color: #6B7280; }
.dstats-item dd { margin: 4px 0 0; font-size: 18px; font-weight: 800; line-height: 1.3; color: #12141A; }
.dstats-last { font-size: 15px; font-weight: 600; }
.dstats-note { font-size: 13px; line-height: 1.45; color: #6B7280; }
.dfaq-q, .dfaq-a { max-width: 75ch; }
.dfaq-q { margin: 16px 0 4px; font-size: 17px; font-weight: 800; line-height: 1.35; }
.dfaq-a { margin: 0; font-size: 15px; line-height: 1.55; color: #4A5060; }
.neighbors { display: flex; flex-direction: column; gap: 10px; }
.neighbors-title { margin: 0; font-size: 18px; font-weight: 800; }
.neighbors-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.neighbors-list li { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 44px; padding: 8px 14px; border-radius: 12px; border: 1px solid #E3E7EE; background: #fff; }
.neighbors-list a { font-weight: 700; color: #2A5BFF; }
.neighbors-count { font-size: 13px; color: #6B7280; }
.neighbors-count.is-active { color: #92400E; font-weight: 700; }

/* Address check (stage 2) */
.op-check { display: flex; flex-direction: column; gap: 8px; padding-top: 16px; border-top: 1px solid #EEF1F6; }
.op-check[hidden] { display: none; }
.op-check label { font-size: 14px; font-weight: 700; }
.op-check-row { display: flex; flex-wrap: wrap; gap: 8px; }
.op-check input { flex: 1 1 240px; min-width: 0; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--op-line-strong); font-family: inherit; font-size: 15px; font-weight: 500; color: var(--op-text); background: #fff; }
.op-check input:focus { outline: 2px solid var(--op-accent); outline-offset: 1px; border-color: transparent; }
.op-btn-dark { background: var(--op-text); color: #fff; }
.op-btn-dark:hover { background: #2B2F3A; }
.op-check-result:empty { display: none; }
.op-check-result { padding: 12px 14px; border-radius: 12px; background: var(--op-soft); font-size: 14px; line-height: 1.5; color: var(--op-text-2); display: flex; flex-direction: column; gap: 10px; }
.op-check-result strong { display: block; font-size: 15px; color: var(--op-text); }
.op-check-result.is-yes { background: #FEF3C7; }
.op-check-result.is-no { background: #ECFDF3; }
.op-check-result a:not(.op-btn) { color: var(--op-accent); font-weight: 600; }
.op-check-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.op-subscribe-legal { margin-top: 6px; font-size: 12px; line-height: 1.45; color: var(--op-text-3); }
.op-subscribe-legal a { text-decoration: underline; }

/* Timeline (stage 2) */
.op-timeline ol { list-style: none; padding: 0; display: flex; flex-direction: column; }
/* Earlier outages at the same place (OutageEpisodes::past()). */
.op-episodes ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.op-episodes li { line-height: 1.45; font-variant-numeric: tabular-nums; }
.op-episodes-note { font-size: 13px; color: var(--op-text-3); }
.op-event { position: relative; display: flex; gap: 14px; padding-bottom: 18px; }
.op-event:last-child { padding-bottom: 0; }
.op-event::before { content: ''; position: absolute; left: 5px; top: 18px; bottom: 0; width: 2px; background: var(--op-line); }
.op-event:last-child::before { display: none; }
.op-event-dot { position: relative; flex-shrink: 0; width: 12px; height: 12px; margin-top: 5px; border-radius: 50%; background: #9AA1AE; box-sizing: border-box; }
.op-event-start .op-event-dot { background: #B42318; }
.op-event-change .op-event-dot { background: #D97706; }
.op-event-done .op-event-dot { background: #16A34A; }
.op-event-reopen .op-event-dot { background: #B42318; }
.op-event-now .op-event-dot { background: var(--op-accent); box-shadow: 0 0 0 4px var(--op-accent-light); }
.op-event-future .op-event-dot { background: transparent; border: 2px dashed #9AA1AE; }
.op-event-overdue .op-event-dot { background: #EA580C; box-shadow: 0 0 0 4px #FFEDD5; }
.op-event-title { font-weight: 700; line-height: 1.4; }
.op-event-now .op-event-title { color: var(--op-accent); }
.op-event-future .op-event-title { color: var(--op-text-2); }
.op-event-overdue .op-event-title { color: #9A3412; }
.op-event-detail { margin-top: 2px; font-size: 14px; line-height: 1.45; color: var(--op-text-3); overflow-wrap: anywhere; }

/* Nearby (stage 2) */
.op-nearby { display: flex; flex-direction: column; gap: 12px; }
.op-nearby-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.op-near { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 16px; border: 1px solid var(--op-line); background: #fff; color: var(--op-text); min-width: 0; }
.op-near:hover { border-color: var(--op-accent); }
.op-near-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.op-near-badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #EEF1F6; color: var(--op-text-2); }
.op-near-res-electricity { background: #FFF4D6; color: #92400E; }
.op-near-res-cold_water { background: #E1F1FB; color: #075985; }
.op-near-res-hot_water { background: #FBE1E9; color: #9D174D; }
.op-near-res-heating { background: #FBE0D8; color: #9A3412; }
.op-near-res-gas { background: #FCE6D6; color: #9A3412; }
.op-near-badge.op-badge-state-active { background: #FEF3C7; color: #92400E; }
.op-near-badge.op-badge-state-planned { background: var(--op-accent-light); color: var(--op-accent-hover); }
.op-near-badge.op-badge-state-overdue { background: #FFEDD5; color: #9A3412; }
.op-near-title { font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.op-near-when { font-size: 14px; color: var(--op-text-3); }
.op-near-all { align-items: center; justify-content: center; text-align: center; border-style: dashed; border-color: #C9CFDB; background: transparent; color: var(--op-accent); font-weight: 700; }

/* Outage map card (partials/outage-map.php inside) */
.op-map { gap: 12px; }
.op-map h2 { font-size: 17px; }
.op-map .omap { margin: 0; }
/* The outage page's map card has nothing to show without JS. */
html:not(.js) .op-map { display: none; }

.op-bar { display: none; }

@media (max-width: 719px) {
    .op-shell { gap: 16px; padding-top: 14px; padding-bottom: 24px; }
    .op-crumbs-home { display: none; }
    .op-body { flex-direction: column; flex-wrap: nowrap; gap: 16px; align-items: stretch; }
    .op-main, .op-aside { display: contents; }
    /* Right after the status card: who to call is the first thing a visitor without power needs. */
    .op-report { order: 0; }
    .op-facts-card { order: 1; }
    .op-map { order: 2; }
    .op-addresses { order: 2; }
    .op-provider { order: 3; }
    .op-timeline { order: 4; }
    .op-episodes { order: 4; }
    .op-source { order: 5; }
    .op-nearby { order: 6; }
    .op-faq { order: 6; }
    .op-neighbors { order: 6; }
    .op-disclaimer { order: 6; }
    .report { border-radius: 18px; padding: 18px; }
    .op-subscribe { order: 7; }
    .op-tips { display: none; }
    .op-nearby-grid { grid-template-columns: 1fr; gap: 8px; }
    .op-card, .op-subscribe { border-radius: 18px; padding: 18px; }
    .op-facts-card { padding: 0; }
    .op-fact { flex-basis: 40%; padding: 14px 16px; }
    .op-fact-wide { flex-basis: 100%; }
    .op-fact dd { font-size: 16px; }
    .op-title { align-items: flex-start; gap: 12px; }
    .op-title-icon { width: 44px; height: 44px; border-radius: 14px; }
    .op-title h1 { font-size: 28px; }
    .op-lead { font-size: 16px; }
    .op-actions-notify { display: none; }
    .op h2 { font-size: 18px; }
    .op-bar {
        position: sticky;
        bottom: 0;
        z-index: 20;
        display: flex;
        gap: 10px;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, .96);
        border-top: 1px solid var(--op-line);
    }
    .op-bar .op-btn { flex: 1; min-height: 48px; }
}

/* Outage map (partials/outage-map.php, js/outage-map.js).
   Only with JS (html.js, set in layout.php before first paint): without it
   the box is never displayed, with it the height is reserved from the start. */
.omap { display: none; margin: 0 0 16px; }
.js .omap { display: block; }
.omap-frame {
    position: relative;
    width: 100%;
    height: 340px;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    background: #eef1f5;
}
.omap-lg .omap-frame { height: clamp(380px, 64vh, 640px); }
@media (max-width: 640px) {
    .omap-frame { height: 300px; }
}
/* Sized, not absolutely positioned: maplibre-gl.css sets the container to position: relative. */
.omap-canvas { width: 100%; height: 100%; }
.omap-cover {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
    font-size: 14px;
    color: var(--muted);
    background: #eef1f5;
}
.omap-cover[hidden], .omap-cover [hidden] { display: none !important; }
.omap-error { max-width: 340px; }
.omap-legend { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 8px 0 0; }
.omap-legend ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    color: var(--muted);
}
.omap-legend li { display: flex; align-items: center; gap: 6px; }
.omap-swatch { width: 14px; height: 10px; border-radius: 2px; border: 1px solid #5f6b7a; }
.omap-swatch-none { background: rgba(138, 148, 163, .12); }
.omap-swatch-planned48 { background: rgba(26, 115, 232, .35); }
.omap-swatch-active { background: rgba(217, 48, 37, .4); }
.omap-swatch-derived { background: transparent; border-style: dashed; }
.omap-dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.omap-dot-emergency { background: #d93025; }
.omap-dot-planned { background: #1a73e8; }
.omap-dot-unknown { background: #e37400; }
.omap-ring { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--muted-2); }
.omap-credits { margin: 6px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.omap-credits a { color: inherit; }
.omap-pop { font-size: 13px; line-height: 1.4; }
.omap-pop-title { display: block; font-size: 14px; }
.omap-pop-place { color: var(--muted); margin-bottom: 4px; }
.omap-pop-link { display: inline-block; margin-top: 6px; font-weight: 600; }
.sources-list { margin: 0 0 12px; padding-left: 20px; line-height: 1.7; }

/* Legal texts (pages/legal.php, from resources/content/<cc>/*.md). */
.legal-text { max-width: 760px; line-height: 1.65; font-size: 15.5px; }
.legal-text h2 { font-size: 20px; margin: 32px 0 10px; }
.legal-text h3 { font-size: 17px; margin: 24px 0 8px; }
.legal-text p, .legal-text ul, .legal-text ol { margin: 0 0 14px; }
.legal-text ul, .legal-text ol { padding-left: 22px; }
.legal-text li + li { margin-top: 6px; }
.legal-text a { color: #2A5BFF; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.legal-table { overflow-x: auto; margin: 0 0 16px; }
.legal-table table { border-collapse: collapse; width: 100%; font-size: 14px; background: var(--surface); }
.legal-table th, .legal-table td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.legal-table th { background: #f0f2f6; font-weight: 700; }

/* Footer "Configurar cookies": a button that looks like the footer links. */
.footer-link-button { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }

/* Analytics consent notice (partials/cookie-consent.php): fixed, so it never
   shifts the layout; both choices carry the same weight. */
.cookie-consent { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 1000; }
.cookie-consent[hidden] { display: none; }
.cookie-consent-inner { max-width: 880px; margin: 0 auto; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow); padding: 16px 18px; display: flex; gap: 16px; align-items: center; }
.cookie-consent-text { flex: 1; font-size: 14px; line-height: 1.5; }
.cookie-consent-text p { margin: 4px 0 0; }
.cookie-consent-text a { color: var(--accent-dark); text-decoration: underline; }
.cookie-consent-actions { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-btn { background: var(--accent); color: #fff; min-width: 110px; }
.cookie-btn:hover { background: var(--accent-dark); }
@media (max-width: 640px) {
    .cookie-consent-inner { flex-direction: column; align-items: stretch; }
    .cookie-consent-actions .cookie-btn { flex: 1; }
}

/* Place search (partials/place-search.php, static/js/place-search.js). */
.place-search { max-width: 620px; margin: 0 0 18px; }
.place-search-label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.place-search-row { display: flex; gap: 8px; }
.place-search-field { position: relative; flex: 1; min-width: 0; }
.place-search-input { width: 100%; box-sizing: border-box; height: 50px; padding: 0 16px; font: inherit; font-size: 16px; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; }
.place-search-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.place-search-button { height: 50px; padding: 0 22px; }
.place-search-hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.place-search-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 50; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow); max-height: 340px; overflow-y: auto; }
.place-search-list[hidden] { display: none; }
.place-search-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.place-search-list li[aria-selected="true"], .place-search-list li:hover { background: #eef2ff; }
.place-search-name { font-weight: 600; }
.place-search-city { color: var(--muted); font-size: 13.5px; text-align: right; }
.search-results, .search-cities { margin: 0 0 24px; padding-left: 20px; line-height: 1.9; }
.search-results .muted { margin-left: 6px; font-size: 14px; }
.search-cities { columns: 2 220px; }
@media (max-width: 480px) {
    .place-search-button { padding: 0 16px; }
}

/* Country pages of seo task 2.2: distributor pages and the complaint guide. */
.company-now { font-size: 17px; font-weight: 700; line-height: 1.45; margin: 0 0 16px; }
.company-groups { display: flex; flex-direction: column; gap: 14px; }
.company-group .pill-list { margin-top: 8px; }
.company-city { margin: 0; font-size: 17px; font-weight: 800; }
.company-city a { color: #2A5BFF; }
.guide p { max-width: 75ch; font-size: 16px; line-height: 1.6; color: #2B2F3A; }
.guide-step { margin: 22px 0 6px; font-size: 19px; font-weight: 800; line-height: 1.3; }
.guide .guide-step:first-child { margin-top: 0; }
.report-guide { font-size: 14px; font-weight: 700; }
.report-guide a { color: #2A5BFF; }
