:root {
      color-scheme: light;
      --bg: #f3f6fb;
      --surface: #ffffff;
      --surface-2: #f7f9fc;
      --surface-3: #eaf0f8;
      --text: #162033;
      --muted: #68758a;
      --line: #dbe3ef;
      --accent: #2f6fd6;
      --accent-deep: #1f4fa3;
      --accent-soft: #e6efff;
      --warning: #e7a328;
      --warning-soft: #fff3d7;
      --danger: #dd5d55;
      --danger-soft: #ffebe8;
      --info: #3678e5;
      --shadow: 0 10px 34px rgba(31, 66, 112, .08);
      --sidebar: #102a4c;
      --sidebar-muted: #a9bad0;
    }

    * { box-sizing: border-box; }
    html { font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
    body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); }
    button { font: inherit; }
    .app { min-height: 100vh; }

    .sidebar {
      position: fixed; inset: 0 auto 0 0; z-index: 20; width: 260px;
      display: flex; flex-direction: column; padding: 24px 16px 18px;
      color: white; background: var(--sidebar); overflow-y: auto;
    }
    .brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 26px; }
    .brand-mark { position: relative; width: 38px; height: 38px; border-radius: 12px; background: #78a9ff; box-shadow: inset 0 -8px 18px rgba(0,0,0,.1); }
    .brand-mark::before, .brand-mark::after { content: ""; position: absolute; background: #102a4c; border-radius: 99px; }
    .brand-mark::before { width: 18px; height: 5px; left: 10px; top: 17px; }
    .brand-mark::after { width: 5px; height: 18px; left: 17px; top: 10px; }
    .brand strong { display:block; font-size: 16px; letter-spacing: .01em; }
    .brand small { color: var(--sidebar-muted); font-size:13px; }
    .nav-label { padding: 9px 12px 8px; color: #7f9bbb; font-size:10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
    .nav { display: grid; gap: 4px; }
    .nav-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 11px; color: var(--sidebar-muted); text-decoration: none; font-size: 14px; font-weight: 550; transition: .18s ease; }
    .nav-item:hover { color: white; background: rgba(255,255,255,.06); }
    .nav-item.active { color: white; background: rgba(91, 148, 245, .2); }
    .nav-item.active .icon { color: #85b4ff; }
    .icon { width: 19px; height: 19px; display: grid; place-items: center; color: #86a1c0; }
    .icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .badge { margin-left: auto; min-width: 22px; padding: 3px 7px; border-radius: 99px; color: #ffd5ce; background: rgba(228,90,80,.18); font-size:13px; text-align:center; }
    .main { min-height: 100vh; margin-left: 260px; }
    .topbar { height: 78px; display:flex; align-items:center; justify-content:space-between; gap:16px; padding: 0 32px; border-bottom:1px solid var(--line); background: color-mix(in srgb, var(--bg) 89%, transparent); backdrop-filter: blur(14px); }
    .headline small { display:block; color:var(--muted); font-size:13px; margin-bottom:3px; }
    .headline h1 { margin:0; font-size:22px; line-height:1.15; letter-spacing:-.025em; }
    .top-actions { display:flex; align-items:center; gap:10px; }
    .clock { text-align:right; margin-right:9px; }
    .clock strong { display:block; font-size:13px; }
    .clock span { color:var(--muted); font-size:13px; }
    .round-btn, .menu-btn { width:40px; height:40px; display:grid; place-items:center; border:1px solid var(--line); border-radius:11px; color:var(--text); background:var(--surface); cursor:pointer; transition:.18s; }
    .round-btn:hover, .menu-btn:hover { border-color:var(--accent); transform:translateY(-1px); }
    .round-btn svg, .menu-btn svg { width:18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; }
    .menu-btn { display:none; }
    .avatar { width:40px; height:40px; display:grid; place-items:center; margin-left:3px; border-radius:12px; color:white; background:linear-gradient(145deg,#4f86df,#234f98); font-weight:750; font-size:13px; }

    .stolsd-brand { color:#fff; text-decoration:none; padding-top:4px; }
    .stolsd-brand-mark { width:44px; height:44px; display:grid; place-items:center; flex:none; border-radius:13px; background:linear-gradient(145deg,#6aa2ff,#2f6fd6); box-shadow:0 8px 20px rgba(0,0,0,.2); font-size:15px; font-weight:900; letter-spacing:.03em; }
    .stolsd-brand strong { font-size:20px; line-height:1.05; }
    .stolsd-brand small { display:block; margin-top:4px; font-size:11px; }

    .content { max-width: 1600px; margin:0 auto; padding: 26px 32px 36px; }
    .section-heading { display:flex; align-items:flex-end; justify-content:space-between; margin-bottom:15px; }
    .section-heading h2 { margin:0; font-size:15px; letter-spacing:-.01em; }
    .section-heading p { margin:4px 0 0; color:var(--muted); font-size:13px; }
    .link { color:var(--accent-deep); font-weight:700; font-size:13px; text-decoration:none; }

    .metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:24px; }
    .metric { position:relative; min-height:116px; padding:18px; border:1px solid var(--line); border-radius:16px; background:var(--surface); box-shadow:var(--shadow); overflow:hidden; }
    .metric-top { display:flex; align-items:center; justify-content:space-between; }
    .metric-label { color:var(--muted); font-size:13px; }
    .metric-icon { width:32px; height:32px; display:grid; place-items:center; border-radius:10px; color:var(--accent-deep); background:var(--accent-soft); }
    .metric-icon.warning { color:#aa6d00; background:var(--warning-soft); }
    .metric-icon.danger { color:var(--danger); background:var(--danger-soft); }
    .metric-icon svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.8; }
    .metric-value { margin-top:7px; font-size:27px; font-weight:760; letter-spacing:-.04em; }
    .metric-note { margin-left:6px; color:var(--muted); font-size:13px; font-weight:500; }
    .trend { display:inline-flex; align-items:center; gap:4px; margin-top:4px; color:var(--accent); font-size:13px; font-weight:650; }
    .trend.neutral { color:var(--muted); }

    .dashboard-grid { display:grid; grid-template-columns:minmax(0,1.55fr) minmax(300px,.75fr); gap:16px; }
    .card { border:1px solid var(--line); border-radius:17px; background:var(--surface); box-shadow:var(--shadow); }
    .card-header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:18px 20px 14px; }
    .card-title h3 { margin:0; font-size:14px; }
    .card-title p { margin:4px 0 0; color:var(--muted); font-size:13px; }
    .segmented { display:flex; gap:3px; padding:3px; border-radius:9px; background:var(--surface-3); }
    .segmented button { padding:5px 9px; border:0; border-radius:7px; color:var(--muted); background:transparent; font-size:13px; cursor:pointer; }
    .segmented button.active { color:var(--text); background:var(--surface); box-shadow:0 2px 8px rgba(0,0,0,.07); }

    .map-card { min-height:414px; overflow:hidden; }
    .map { position:relative; height:346px; margin:0 7px 7px; border-radius:13px; background:var(--surface-2); overflow:hidden; }
    .map svg { width:100%; height:100%; }
    .map-image { width:100%; height:100%; display:block; object-fit:cover; }
    .map-grid line { stroke:var(--line); stroke-width:1; }
    .road { fill:none; stroke:color-mix(in srgb,var(--muted) 27%,transparent); stroke-width:9; stroke-linecap:round; }
    .road-center { fill:none; stroke:var(--surface-2); stroke-width:4; stroke-dasharray:10 7; }
    .district { fill:var(--accent-soft); stroke:var(--accent); stroke-width:1.4; }
    .district.alt { fill:var(--surface-3); stroke:var(--line); }
    .map-label { fill:var(--muted); font-size:13px; font-weight:650; }
    .station { cursor:pointer; }
    .station circle:first-child { fill:var(--surface); stroke:var(--line); stroke-width:1; }
    .station circle:last-child { fill:var(--accent); }
    .station.warn circle:last-child { fill:var(--warning); }
    .station.danger circle:last-child { fill:var(--danger); }
    .map-legend { position:absolute; left:15px; bottom:14px; display:flex; gap:13px; padding:9px 11px; border:1px solid var(--line); border-radius:10px; background:color-mix(in srgb,var(--surface) 92%,transparent); box-shadow:var(--shadow); font-size:13px; }
    .legend-item { display:flex; align-items:center; gap:6px; color:var(--muted); }
    .legend-dot { width:7px; height:7px; border-radius:50%; background:var(--accent); }
    .legend-dot.warn { background:var(--warning); } .legend-dot.danger { background:var(--danger); }

    .events-card { min-height:414px; }
    .event-list { padding:0 20px 10px; }
    .event { display:grid; grid-template-columns:34px 1fr auto; gap:11px; align-items:start; padding:13px 0; border-top:1px solid var(--line); }
    .event-icon { width:31px; height:31px; display:grid; place-items:center; border-radius:9px; color:var(--warning); background:var(--warning-soft); }
    .event-icon.danger { color:var(--danger); background:var(--danger-soft); }
    .event-icon.info { color:var(--info); background:color-mix(in srgb,var(--info) 12%,transparent); }
    .event-icon svg { width:15px; fill:none; stroke:currentColor; stroke-width:1.9; }
    .event h4 { margin:1px 0 4px; font-size:13px; }
    .event p { margin:0; color:var(--muted); font-size:13px; line-height:1.45; }
    .event time { color:var(--muted); font-size:13px; white-space:nowrap; }
    .events-footer { margin:2px 20px 18px; padding:10px; border-radius:10px; color:var(--accent-deep); background:var(--accent-soft); text-align:center; font-size:13px; font-weight:700; cursor:pointer; }

    .lower-grid { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(0,.75fr); gap:16px; margin-top:16px; }
    .chart-wrap { padding:0 20px 17px; }
    .chart-meta { display:flex; align-items:flex-end; gap:8px; margin:0 0 7px; }
    .chart-meta strong { font-size:24px; letter-spacing:-.04em; }
    .chart-meta span { padding-bottom:3px; color:var(--muted); font-size:13px; }
    .chart { width:100%; height:126px; overflow:visible; }
    .chart .grid { stroke:var(--line); stroke-width:1; }
    .chart .area { fill:url(#areaFill); }
    .chart .line { fill:none; stroke:var(--accent); stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; }
    .chart text { fill:var(--muted); font-size:13px; }
    .chart .point { fill:var(--surface); stroke:var(--accent); stroke-width:2; }

    .zones { padding:0 20px 15px; }
    .zone { display:grid; grid-template-columns:8px 1fr auto; gap:10px; align-items:center; padding:11px 0; border-top:1px solid var(--line); }
    .zone-dot { width:7px; height:7px; border-radius:50%; background:var(--accent); }
    .zone-dot.warn { background:var(--warning); } .zone-dot.danger { background:var(--danger); }
    .zone strong { display:block; font-size:13px; }
    .zone span { color:var(--muted); font-size:13px; }
    .zone-value { text-align:right; }
    .zone-value b { display:block; font-size:13px; }

    .overlay { display:none; position:fixed; inset:0; z-index:15; background:rgba(4,15,10,.5); backdrop-filter:blur(2px); }
    @media (max-width: 1100px) {
      .metrics { grid-template-columns:repeat(2,1fr); }
      .dashboard-grid, .lower-grid { grid-template-columns:1fr; }
    }
    @media (max-width: 760px) {
      .sidebar { transform:translateX(-100%); transition:transform .25s ease; }
      body.nav-open .sidebar { transform:translateX(0); }
      body.nav-open .overlay { display:block; }
      .main { margin-left:0; }
      .menu-btn { display:grid; }
      .topbar { height:70px; padding:0 16px; }
      .headline small, .clock { display:none; }
      .headline h1 { font-size:18px; }
      .content { padding:20px 16px 28px; }
      .metrics { grid-template-columns:1fr 1fr; gap:10px; }
      .metric { min-height:108px; padding:15px; }
      .metric-value { font-size:23px; }
      .map { height:300px; }
    }
    @media (max-width: 460px) {
      .metrics { grid-template-columns:1fr; }
      .metric { min-height:98px; }
      .avatar { display:none; }
      .card-header { align-items:flex-start; flex-direction:column; }
      .map-legend { flex-wrap:wrap; right:15px; }
    }

    .overview-grid { grid-template-columns: 1fr; }
    .brand.logo-brand { display:block; margin:0 5px 26px; padding:10px 11px; border-radius:12px; background:#ffffff; box-shadow:0 7px 20px rgba(0,0,0,.12); }
    .brand-logo { display:block; width:100%; height:auto; }
    .subnav { display:grid; gap:2px; margin:2px 0 7px 31px; padding-left:13px; border-left:1px solid rgba(150,184,169,.25); }
    .subnav-item { display:flex; align-items:center; gap:9px; min-height:32px; padding:0 10px; border-radius:8px; color:var(--sidebar-muted); text-decoration:none; font-size:13px; transition:.16s ease; }
    .subnav-item:hover { color:#fff; background:rgba(255,255,255,.05); }
    .subnav-item.active { color:#fff; background:rgba(84,202,149,.13); font-weight:700; }
    .subnav-dot { width:5px; height:5px; border-radius:50%; background:#708d81; }
    .subnav-item.active .subnav-dot { background:#62d7a3; box-shadow:0 0 0 4px rgba(98,215,163,.1); }
    .sidebar-credit { display:block; margin:auto 12px 2px; padding-top:28px; color:var(--sidebar-muted); text-decoration:none; opacity:.62; transition:.18s ease; }
    .sidebar-credit:hover { opacity:.9; }
    .sidebar-credit span { display:block; margin-bottom:7px; font-size:13px; letter-spacing:.1em; text-transform:uppercase; }
    .sidebar-credit img { display:block; width:132px; height:auto; filter:grayscale(1) brightness(0) invert(1); }
    .nav-branch-toggle { width:100%; border:0; color:var(--sidebar-muted); background:transparent; text-align:left; cursor:pointer; font-family:inherit; }
    .nav-chevron { width:18px; height:18px; display:grid; flex:0 0 18px; place-items:center; margin-left:auto; color:#819c91; transition:transform .18s ease; }
    .nav-chevron svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
    .nav-branch .subnav { display:none; }
    .nav-branch.open .subnav { display:grid; }
    .nav-branch.open .nav-chevron { transform:rotate(180deg); }
    .overview-grid .events-card { min-height: auto; }
    .overview-grid .event-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:28px; }
    .page-map-card { overflow:hidden; }
    .page-map-shell { position:relative; width:100%; height:calc(100vh - 78px); min-height:600px; overflow:hidden; background-color:#edf2ef; background-image:radial-gradient(circle,rgba(55,94,76,.16) 1px,transparent 1.2px),linear-gradient(rgba(55,94,76,.075) 1px,transparent 1px),linear-gradient(90deg,rgba(55,94,76,.075) 1px,transparent 1px); background-size:24px 24px,120px 120px,120px 120px; }
    .page-map-shell::after { content:""; position:absolute; inset:0; z-index:4; pointer-events:none; background:radial-gradient(circle at 52% 46%,transparent 52%,rgba(30,61,47,.055) 100%); }
    .page-map-shell > .page-map { position:absolute; inset:0; width:100%; height:100%; background:transparent; }
    .map-theme-link { position:absolute; z-index:6; top:14px; left:14px; height:38px; display:inline-flex; align-items:center; gap:8px; padding:0 13px; border:1px solid rgba(88,112,100,.2); border-radius:11px; color:#344a40; background:rgba(255,255,255,.84); box-shadow:0 8px 24px rgba(35,62,49,.1); font-size:13px; font-weight:750; text-decoration:none; backdrop-filter:blur(12px); }
    .map-theme-link:hover { color:var(--accent-deep); border-color:rgba(22,115,79,.35); }
    .map-theme-link svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
    .map-page-body .content { max-width:none; padding:0; }
    .map-floating-title { position:absolute; z-index:5; top:18px; left:18px; min-width:260px; padding:14px 16px; border:1px solid rgba(100,120,110,.28); border-radius:13px; background:rgba(255,255,255,.93); box-shadow:var(--shadow); backdrop-filter:blur(10px); }
    .map-floating-title h2 { margin:0 0 5px; font-size:15px; }
    .map-floating-title p { margin:0; color:var(--muted); font-size:13px; }
    .map-floating-legend { position:absolute; z-index:5; right:18px; bottom:20px; display:flex; gap:14px; padding:11px 13px; border:1px solid rgba(88,112,100,.2); border-radius:12px; background:rgba(255,255,255,.82); box-shadow:0 9px 28px rgba(35,62,49,.1); backdrop-filter:blur(12px); }
    .map-data-source { position:absolute; z-index:5; left:18px; bottom:20px; padding:9px 12px; border-radius:9px; color:#405048; background:rgba(255,255,255,.9); box-shadow:var(--shadow); font-size:13px; }
    .maplibregl-map { font-family:inherit; }
    .maplibregl-canvas { outline:none; }
    .maplibregl-ctrl-group { border:1px solid rgba(88,112,100,.2); border-radius:11px; background:rgba(255,255,255,.84); box-shadow:0 8px 24px rgba(35,62,49,.11); overflow:hidden; backdrop-filter:blur(12px); }
    .maplibregl-ctrl-group button { background-color:transparent; }
    .maplibregl-ctrl-group button { width:34px; height:34px; }
    .maplibregl-ctrl-scale { border-color:#718079; color:#526159; background:rgba(255,255,255,.86); }
    .map-dark-page { color:#dbe9f4; background:#071727; }
    .map-dark-page .sidebar { background:#07192c; }
    .map-dark-page .nav-item.active { background:rgba(65,151,207,.2); }
    .map-dark-page .nav-item.active .icon { color:#68b7ea; }
    .map-dark-page .topbar { border-color:#1d3449; color:#eaf4fb; background:rgba(8,25,43,.96); }
    .map-dark-page .headline small,.map-dark-page .clock span { color:#829caf; }
    .map-dark-page .round-btn { border-color:#294056; color:#dceaf4; background:#10283d; }
    .map-dark-page .avatar { background:linear-gradient(145deg,#2c779e,#17445f); }
    .map-dark-page .page-map-shell { background-color:#07192c; background-image:radial-gradient(circle,rgba(89,145,190,.24) 1px,transparent 1.2px),linear-gradient(rgba(78,127,166,.12) 1px,transparent 1px),linear-gradient(90deg,rgba(78,127,166,.12) 1px,transparent 1px); }
    .map-dark-page .page-map-shell::after { background:radial-gradient(circle at 52% 46%,transparent 50%,rgba(0,8,18,.25) 100%); }
    .map-dark-page .map-theme-link { border-color:rgba(119,165,198,.25); color:#c7dbea; background:rgba(11,34,54,.88); box-shadow:0 8px 26px rgba(0,8,18,.28); }
    .map-dark-page .map-floating-legend { border-color:rgba(119,165,198,.24); color:#afc4d3; background:rgba(9,29,47,.86); box-shadow:0 9px 30px rgba(0,8,18,.3); }
    .map-dark-page .maplibregl-ctrl-group { border-color:rgba(119,165,198,.24); background:rgba(10,32,51,.9); box-shadow:0 8px 26px rgba(0,8,18,.3); }
    .map-dark-page .maplibregl-ctrl-group button + button { border-top-color:#29445b; }
    .map-dark-page .maplibregl-ctrl-icon { filter:invert(1) brightness(1.6); }
    .map-dark-page .maplibregl-ctrl-scale { border-color:#58758b; color:#b5cad9; background:rgba(9,29,47,.84); }
    .map-dark-page .maplibregl-popup-content { border-color:#29465d; color:#dceaf4; background:#0d2539; box-shadow:0 18px 46px rgba(0,5,12,.42); }
    .map-dark-page .maplibregl-popup-tip { border-top-color:#0d2539!important; border-bottom-color:#0d2539!important; }
    .map-dark-page .maplibregl-popup-close-button,.map-dark-page .building-popup-address { color:#e8f2f9; }
    .map-dark-page .building-popup-statuses { border-color:#29445a; }
    .map-dark-page .building-status-row,.map-dark-page .itp-link > span:first-child { color:#91aabd; }
    .map-dark-page .apartments-link,.map-dark-page .itp-link > span:first-child { color:#62c89c; }
    .maplibregl-popup-content { min-width:285px; padding:20px 22px; border:1px solid var(--line); border-radius:14px; box-shadow:0 14px 38px rgba(25,55,42,.2); }
    .maplibregl-popup-close-button { width:34px; height:34px; color:var(--muted); font-size:21px; }
    .building-popup-address { padding-right:22px; color:var(--text); font-size:16px; font-weight:750; line-height:1.4; }
    .building-popup-statuses { display:grid; gap:7px; margin-top:15px; padding-top:14px; border-top:1px solid var(--line); }
    .building-status-row { display:flex; align-items:center; justify-content:space-between; gap:22px; color:var(--muted); font-size:13px; }
    .building-status-value { display:inline-flex; align-items:center; gap:8px; color:var(--text); font-size:13px; font-weight:750; }
    .building-status-value::before { content:""; width:9px; height:9px; border-radius:50%; background:#9aa8a1; }
    .building-status-value.normal { color:#087448; }
    .building-status-value.normal::before { background:#22ad73; box-shadow:0 0 0 4px rgba(34,173,115,.12); }
    .building-status-value.alarm { color:#ca3f35; }
    .building-status-value.alarm::before { background:#e2554b; box-shadow:0 0 0 4px rgba(226,85,75,.12); }
    .building-status-value.warning { color:#a86d05; }
    .building-status-value.warning::before { background:#e7a328; box-shadow:0 0 0 4px rgba(231,163,40,.13); }
    .apartments-link { padding:0; border:0; color:var(--accent-deep); background:none; font:inherit; font-weight:750; text-decoration:underline; text-decoration-color:rgba(17,99,66,.3); text-underline-offset:3px; cursor:pointer; }
    .apartments-link:hover { color:var(--accent); text-decoration-color:currentColor; }
    .itp-link { width:100%; display:flex; align-items:center; justify-content:space-between; gap:22px; padding:0; border:0; color:inherit; background:none; font:inherit; text-decoration:none; cursor:pointer; }
    .itp-link > span:first-child { color:var(--accent-deep); font-weight:750; text-decoration:none; }
    .itp-link:hover > span:first-child { color:var(--accent); }
    .itp-modal { position:fixed; inset:0; z-index:1100; display:none; align-items:center; justify-content:center; padding:22px; background:rgba(7,20,15,.68); backdrop-filter:blur(7px); }
    .itp-modal.open { display:flex; }
    .itp-dialog { width:min(1480px,100%); max-height:calc(100vh - 44px); display:flex; flex-direction:column; border:1px solid rgba(87,121,106,.4); border-radius:18px; background:#f4f7f5; box-shadow:0 28px 90px rgba(3,18,11,.38); overflow:hidden; }
    .itp-header { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:15px 20px; border-bottom:1px solid var(--line); background:#fff; }
    .itp-header h2 { margin:0; font-size:21px; }
    .itp-address { margin-top:3px; color:var(--muted); font-size:13px; }
    .itp-close { width:36px; height:36px; display:grid; place-items:center; flex:0 0 auto; border:1px solid var(--line); border-radius:10px; color:var(--muted); background:#fff; font-size:23px; cursor:pointer; }
    .itp-close:hover { color:var(--danger); border-color:var(--danger); }
    .itp-scroll { overflow:auto; padding:18px; }
    .itp-scheme-card { overflow:hidden; border:1px solid #30333b; border-radius:14px; background:#18191f; box-shadow:0 12px 30px rgba(12,16,14,.16); }
    .itp-scheme { width:100%; height:auto; min-height:390px; display:block; }
    .itp-scheme .hot { fill:none; stroke:#bd2b28; stroke-width:18; stroke-linejoin:round; }
    .itp-scheme .cold { fill:none; stroke:#373291; stroke-width:18; stroke-linejoin:round; }
    .itp-scheme .unit { fill:#25a92d; stroke:#16741d; stroke-width:1.5; }
    .itp-scheme .unit-blue { fill:#13518d; stroke:#0b3764; stroke-width:1.5; }
    .itp-scheme .exchanger { fill:#444; stroke:#79231f; stroke-width:10; }
    .itp-scheme text { fill:#fff; font-family:"Segoe UI",sans-serif; text-anchor:middle; }
    .itp-scheme .label { font-size:13px; }
    .itp-scheme .value { font-size:22px; }
    .itp-scheme .unit-text { font-size:13px; }
    .itp-scheme .section-title { font-size:16px; font-weight:700; }
    .itp-cameras-head { display:flex; align-items:end; justify-content:space-between; gap:18px; margin:20px 2px 11px; }
    .itp-cameras-head h3 { margin:0; font-size:17px; }
    .itp-cameras-head span { color:var(--muted); font-size:13px; }
    .itp-camera-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
    .itp-camera { position:relative; min-height:210px; overflow:hidden; border-radius:13px; background:#111a16; box-shadow:inset 0 0 0 1px rgba(255,255,255,.08); }
    .itp-camera video { width:100%; height:100%; min-height:210px; display:block; object-fit:cover; background:#101713; }
    .itp-camera-name { position:absolute; z-index:2; top:12px; left:12px; padding:6px 9px; border-radius:7px; color:#fff; background:rgba(8,20,15,.76); font-size:13px; font-weight:700; backdrop-filter:blur(6px); }
    .itp-camera-empty { position:absolute; inset:0; display:grid; place-items:center; color:#8fa79c; text-align:center; font-size:13px; }
    .itp-camera-empty svg { width:30px; height:30px; display:block; margin:0 auto 9px; fill:none; stroke:#62a889; stroke-width:1.6; }
    .itp-no-cameras { padding:34px; border:1px dashed var(--line); border-radius:13px; color:var(--muted); text-align:center; }
    .apartments-modal { position:fixed; inset:0; z-index:1000; display:none; align-items:center; justify-content:center; padding:24px; background:rgba(10,28,20,.52); backdrop-filter:blur(5px); }
    .apartments-modal.open { display:flex; }
    .apartments-dialog { width:min(1040px,100%); max-height:min(860px,calc(100vh - 48px)); display:flex; flex-direction:column; border:1px solid var(--line); border-radius:18px; background:var(--surface); box-shadow:0 26px 80px rgba(8,30,20,.3); overflow:hidden; font-family:"Segoe UI Variable Text","Segoe UI",system-ui,sans-serif; }
    .apartments-header { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; padding:14px 20px 12px; border-bottom:1px solid var(--line); }
    .apartments-header h2 { margin:0; font-size:23px; font-weight:720; letter-spacing:-.025em; }
    .apartments-address { margin-top:3px; color:var(--muted); font-size:14px; }
    .apartments-close { width:34px; height:34px; flex:0 0 auto; display:grid; place-items:center; border:1px solid var(--line); border-radius:10px; color:var(--muted); background:var(--surface); font-size:22px; cursor:pointer; }
    .apartments-close:hover { color:var(--danger); border-color:var(--danger); }
    .apartments-toolbar { display:flex; align-items:center; gap:12px; padding:8px 20px; border-bottom:1px solid var(--line); background:var(--surface-2); }
    .apartments-toolbar label { color:var(--muted); font-size:14px; font-weight:600; }
    .entrance-select { min-width:160px; height:34px; padding:0 34px 0 12px; border:1px solid var(--line); border-radius:9px; color:var(--text); background:var(--surface); font:inherit; font-size:14px; font-weight:650; outline:none; }
    .entrance-select:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
    .apartments-scroll { overflow:auto; padding:0 20px 20px; scrollbar-gutter:stable; }
    .apartment-columns, .apartment-row { min-width:760px; display:grid; grid-template-columns:minmax(170px,1fr) repeat(5,100px); gap:8px; align-items:center; }
    .apartment-columns { position:sticky; top:0; z-index:3; padding:10px 12px 8px; color:var(--muted); background:rgba(255,255,255,.96); border-bottom:1px solid var(--line); font-size:13px; font-weight:750; text-align:center; backdrop-filter:blur(8px); }
    .apartment-columns span:first-child { text-align:left; }
    .floor-group { min-width:760px; margin-top:10px; border:1px solid var(--line); border-radius:12px; background:var(--surface); overflow:visible; box-shadow:0 2px 10px rgba(15,55,38,.035); }
    .floor-title { padding:7px 13px; color:var(--accent-deep); background:linear-gradient(90deg,var(--accent-soft),rgba(231,246,239,.35)); font-size:13px; font-weight:750; }
    .apartment-row { padding:7px 12px; border-top:1px solid var(--line); transition:background .12s ease; }
    .apartment-row:hover { position:relative; z-index:12; background:#f8fbf9; }
    .apartment-row:first-of-type { border-top:0; }
    .apartment-number { font-size:14px; font-weight:650; }
    .meter-zero { position:relative; display:grid; place-items:center; min-height:27px; padding:0 5px; border-radius:7px; color:#263b32; background:var(--surface-3); font-size:13px; font-weight:650; font-variant-numeric:tabular-nums; cursor:help; }
    .meter-zero:hover { color:var(--accent-deep); background:var(--accent-soft); }
    .meter-zero:hover { z-index:30; }
    .meter-link { text-decoration:none; cursor:pointer; }
    .meter-link:hover { box-shadow:inset 0 0 0 1px rgba(17,99,66,.18); }
    .meter-zero.missing { color:#8a9690; font-weight:550; }
    .meter-zero.offline { color:var(--danger); background:rgba(222,91,82,.08); }
    .meter-zero.warning { color:#a66d05; background:rgba(231,163,40,.11); }
    .meter-zero::after { content:attr(data-updated); position:absolute; left:50%; bottom:calc(100% + 8px); z-index:20; width:max-content; max-width:260px; padding:9px 11px; border-radius:8px; color:#fff; background:#102a4c; box-shadow:0 8px 22px rgba(16,42,76,.24); font-size:13px; font-weight:500; line-height:1.5; white-space:pre-line; text-align:left; opacity:0; pointer-events:none; transform:translate(-50%,4px); transition:opacity .14s ease,transform .14s ease; }
    .meter-zero::before { content:""; position:absolute; left:50%; bottom:calc(100% + 3px); z-index:21; width:8px; height:8px; background:#102a4c; opacity:0; transform:translateX(-50%) rotate(45deg); transition:opacity .14s ease; }
    .meter-zero:hover::after { opacity:1; transform:translate(-50%,0); }
    .meter-zero:hover::before { opacity:1; }
    .apartment-row .meter-zero:last-child::after { left:auto; right:0; transform:translateY(4px); }
    .apartment-row .meter-zero:last-child:hover::after { transform:translateY(0); }
    .apartment-row .meter-zero:last-child::before { left:auto; right:10px; transform:rotate(45deg); }
    .apartments-refresh { height:34px; display:inline-flex; align-items:center; gap:7px; padding:0 12px; border:1px solid var(--line); border-radius:9px; color:var(--accent-deep); background:var(--surface); font:inherit; font-size:13px; font-weight:700; cursor:pointer; }
    .apartments-refresh:hover { border-color:var(--accent); background:var(--accent-soft); }
    .apartments-refresh:disabled { opacity:.55; cursor:wait; }
    .apartments-refresh svg { width:15px; height:15px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
    .apartments-refresh.loading svg { animation:refresh-spin .8s linear infinite; }
    @keyframes refresh-spin { to { transform:rotate(360deg); } }
    @media (max-width:760px) {
      .apartments-modal { padding:0; }
      .apartments-dialog { height:100%; max-height:none; border:0; border-radius:0; }
      .apartments-header, .apartments-toolbar { padding-left:16px; padding-right:16px; }
      .apartments-scroll { padding-left:16px; padding-right:16px; }
      .itp-modal { padding:0; }
      .itp-dialog { height:100%; max-height:none; border:0; border-radius:0; }
      .itp-scroll { padding:12px; }
      .itp-scheme { min-width:900px; }
      .itp-scheme-card { overflow:auto; }
      .itp-camera-grid { grid-template-columns:1fr; }
    }
    .map-source { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:0 22px 18px; color:var(--muted); font-size:13px; }
    .registry-head { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:18px; }
    .registry-head h2 { margin:0; font-size:26px; letter-spacing:-.025em; }
    .registry-head p { margin:6px 0 0; color:var(--muted); font-size:13px; }
    .registry-actions { display:flex; align-items:center; gap:9px; }
    .registry-search { width:300px; height:44px; padding:0 14px; border:1px solid var(--line); border-radius:11px; color:var(--text); background:var(--surface); font:inherit; font-size:14px; outline:none; }
    .registry-search:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
    .registry-button { height:44px; padding:0 17px; border:0; border-radius:11px; color:#fff; background:var(--accent-deep); font:inherit; font-size:13px; font-weight:750; cursor:pointer; }
    .registry-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-bottom:16px; }
    .registry-stat { padding:15px 17px; border:1px solid var(--line); border-radius:14px; background:var(--surface); box-shadow:var(--shadow); }
    .registry-stat span { display:block; color:var(--muted); font-size:13px; }
    .registry-stat strong { display:block; margin-top:7px; font-size:27px; letter-spacing:-.03em; }
    .registry-stat small { color:var(--accent-deep); font-size:13px; font-weight:700; }
    .registry-stat small.warning-summary { display:block; max-width:260px; line-height:1.35; }
    .registry-stat.has-details { cursor:pointer; transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease; }
    .registry-stat.has-details:hover { border-color:color-mix(in srgb,var(--warning) 45%,var(--line)); box-shadow:0 12px 28px rgba(70,54,16,.09); transform:translateY(-1px); }
    .registry-stat.has-details:focus-visible { outline:3px solid color-mix(in srgb,var(--warning) 28%,transparent); outline-offset:2px; }
    .registry-stat.has-details .warning-summary { color:var(--accent-deep); font-weight:750; }
    .warnings-modal { position:fixed; inset:0; z-index:1200; display:none; align-items:center; justify-content:center; padding:24px; background:rgba(8,25,19,.55); backdrop-filter:blur(6px); }
    .warnings-modal.open { display:flex; }
    .warnings-dialog { width:min(980px,100%); max-height:min(760px,calc(100vh - 48px)); overflow:hidden; border:1px solid var(--line); border-radius:18px; background:var(--surface); box-shadow:0 26px 80px rgba(8,28,20,.22); }
    .warnings-dialog-head { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:20px 22px; border-bottom:1px solid var(--line); }
    .warnings-dialog-head span { display:block; margin-bottom:4px; color:var(--muted); font-size:13px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; }
    .warnings-dialog-head h2 { margin:0; font-size:21px; }
    .warnings-close { width:36px; height:36px; flex:none; display:grid; place-items:center; border:1px solid var(--line); border-radius:10px; color:var(--muted); background:var(--surface-2); font:inherit; font-size:24px; line-height:1; cursor:pointer; }
    .warnings-close:hover { color:var(--text); border-color:color-mix(in srgb,var(--accent) 30%,var(--line)); }
    .warnings-list { max-height:calc(min(760px,100vh - 48px) - 78px); overflow:auto; }
    .warnings-list-head,.warnings-list-row { display:grid; grid-template-columns:minmax(170px,1fr) minmax(260px,1.7fr) minmax(145px,.8fr) minmax(150px,.8fr); gap:18px; align-items:center; }
    .warnings-list-head { position:sticky; top:0; z-index:1; padding:10px 22px; border-bottom:1px solid var(--line); color:var(--muted); background:var(--surface-2); font-size:13px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; }
    .warnings-list-row { padding:15px 22px; border-bottom:1px solid var(--line); }
    .warnings-list-row:last-child { border-bottom:0; }
    .warnings-device { min-width:0; display:flex; align-items:center; gap:11px; }
    .warnings-device > i { width:9px; height:9px; flex:none; border-radius:50%; background:var(--warning); box-shadow:0 0 0 4px rgba(231,163,40,.13); }
    .warnings-device strong,.warnings-device span { display:block; }
    .warnings-device strong { font-size:13px; }
    .warnings-device span { margin-top:3px; color:var(--muted); font-size:13px; font-variant-numeric:tabular-nums; }
    .warnings-reason { display:grid; gap:5px; color:#8b5b08; font-size:13px; font-weight:700; line-height:1.4; }
    .warnings-reason span { display:block; }
    .warnings-endpoint,.warnings-list-row time { color:var(--muted); font-size:13px; font-variant-numeric:tabular-nums; }
    .warnings-list-empty { padding:42px 22px; color:var(--muted); text-align:center; }
    @media (max-width:760px) {
      .warnings-modal { align-items:flex-end; padding:0; }
      .warnings-dialog { max-height:88vh; border-radius:18px 18px 0 0; }
      .warnings-list-head { display:none; }
      .warnings-list-row { grid-template-columns:1fr; gap:9px; padding:16px 18px; }
      .warnings-reason { padding-left:20px; }
      .warnings-endpoint,.warnings-list-row time { padding-left:20px; }
    }
    .registry-table-card { border:1px solid var(--line); border-radius:16px; background:var(--surface); box-shadow:var(--shadow); overflow:hidden; }
    .registry-table-title { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:17px 19px; border-bottom:1px solid var(--line); }
    .registry-table-title h3 { margin:0; font-size:17px; }
    .registry-count { padding:6px 10px; border-radius:99px; color:var(--accent-deep); background:var(--accent-soft); font-size:13px; font-weight:800; }
    .registry-table-scroll { overflow-x:auto; }
    .registry-table { width:100%; min-width:1100px; border-collapse:collapse; }
    .registry-table th { padding:13px 15px; color:var(--muted); background:var(--surface-2); font-size:13px; font-weight:750; letter-spacing:.035em; text-align:left; text-transform:uppercase; white-space:nowrap; }
    .registry-table td { padding:14px 15px; border-top:1px solid var(--line); color:#415048; font-size:13px; vertical-align:middle; }
    .registry-table tbody tr:hover td { background:#fbfdfc; }
    .converter-tree-card .registry-table-title small { display:block; margin-top:4px; color:var(--muted); font-size:13px; }
    .converter-tree { padding:12px; background:var(--surface-2); }
    .converter-tree details > summary { list-style:none; }
    .converter-tree details > summary::-webkit-details-marker { display:none; }
    .converter-object-node { overflow:hidden; border:1px solid var(--line); border-radius:14px; background:var(--surface); }
    .converter-object-node + .converter-object-node { margin-top:10px; }
    .converter-object-node > summary { min-height:72px; display:grid; grid-template-columns:18px 42px minmax(0,1fr) auto; gap:12px; align-items:center; padding:12px 17px; cursor:pointer; }
    .converter-tree-caret { width:8px; height:8px; border-right:1.8px solid var(--muted); border-bottom:1.8px solid var(--muted); transform:rotate(-45deg); transition:transform .16s ease; }
    details[open] > summary > .converter-tree-caret { transform:rotate(45deg) translate(-2px,-2px); }
    .converter-object-icon,.converter-host-icon { display:grid; place-items:center; border-radius:11px; color:var(--accent-deep); background:var(--accent-soft); }
    .converter-object-icon { width:42px; height:42px; }
    .converter-object-icon svg,.converter-host-icon svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
    .converter-object-title strong,.converter-object-title small,.converter-host-title strong,.converter-host-title small,.converter-host-meters strong,.converter-host-meters small,.converter-host-time strong,.converter-host-time small { display:block; }
    .converter-object-title strong { font-size:16px; }
    .converter-object-title small { margin-top:4px; color:var(--muted); font-size:13px; }
    .converter-object-total { padding:7px 10px; border-radius:9px; color:var(--accent-deep); background:var(--accent-soft); font-size:13px; font-weight:800; }
    .converter-host-list { padding:0 12px 12px 42px; }
    .converter-host-node { overflow:hidden; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
    .converter-host-node + .converter-host-node { margin-top:8px; }
    .converter-host-node > summary { min-height:68px; display:grid; grid-template-columns:18px 38px minmax(180px,1fr) 90px 170px 110px; gap:11px; align-items:center; padding:11px 14px; cursor:pointer; transition:background .16s ease; }
    .converter-host-node > summary:hover { background:color-mix(in srgb,var(--accent-soft) 45%,var(--surface)); }
    .converter-host-icon { width:38px; height:38px; }
    .converter-host-title strong { font-size:14px; font-variant-numeric:tabular-nums; }
    .converter-host-title small,.converter-host-meters small,.converter-host-time small { margin-top:3px; color:var(--muted); font-size:13px; }
    .converter-host-meters strong,.converter-host-time strong { font-size:13px; font-variant-numeric:tabular-nums; }
    .converter-port-list { border-top:1px solid var(--line); }
    .converter-port-head,.converter-port-row { display:grid; grid-template-columns:90px minmax(140px,1fr) 90px 80px 170px 110px; gap:12px; align-items:center; padding:10px 14px 10px 81px; }
    .converter-port-head { color:var(--muted); background:var(--surface-2); font-size:13px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; }
    .converter-port-row { min-height:40px; padding-top:6px; padding-bottom:6px; border-top:1px solid var(--line); color:#33443b; font-size:13px; }
    .converter-port-row .mono-value { font-size:13px; }
    .converter-port-row .connection { font-size:13px; }
    .converter-port-row:first-of-type { border-top:0; }
    .converter-port-row time { color:var(--muted); font-variant-numeric:tabular-nums; }
    .converter-tree-empty { padding:36px; color:var(--muted); text-align:center; }
    @media (max-width:980px) {
      .converter-host-node > summary { grid-template-columns:18px 38px minmax(160px,1fr) 80px 100px; }
      .converter-host-node > summary > .connection { display:none; }
      .converter-host-time { display:none; }
      .converter-port-list { overflow-x:auto; }
      .converter-port-head,.converter-port-row { min-width:760px; padding-left:32px; }
    }
    @media (max-width:620px) {
      .converter-tree { padding:8px; }
      .converter-object-node > summary { grid-template-columns:16px 36px minmax(0,1fr); padding:11px; }
      .converter-object-icon { width:36px; height:36px; }
      .converter-object-total { display:none; }
      .converter-host-list { padding:0 8px 8px; }
      .converter-host-node > summary { grid-template-columns:16px 34px minmax(0,1fr) auto; padding:10px; }
      .converter-host-icon { width:34px; height:34px; }
      .converter-host-time { display:none; }
    }
    .registry-name { display:flex; align-items:center; gap:10px; min-width:170px; }
    .registry-icon { width:34px; height:34px; flex:0 0 34px; display:grid; place-items:center; margin:0; border-radius:9px; color:var(--accent-deep); background:var(--accent-soft); }
    .registry-icon svg { width:22px; height:22px; display:block; margin:0; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
    .registry-name strong { display:block; color:var(--text); font-size:13px; }
    .registry-name > div > span { display:block; margin-top:4px; color:var(--muted); font-size:13px; }
    .devices-page .registry-table th { padding-top:9px; padding-bottom:9px; }
    .devices-page .registry-table td { padding-top:8px; padding-bottom:8px; }
    .devices-page .registry-icon { width:30px; height:30px; flex-basis:30px; border-radius:8px; }
    .devices-page .registry-icon svg { width:19px; height:19px; }
    .devices-page .registry-name > div > span { margin-top:2px; }
    .object-link { color:var(--text); text-decoration:none; }
    .object-link:hover { color:var(--accent-deep); text-decoration:underline; text-underline-offset:3px; }
    .object-table-row { cursor:pointer; transition:background .16s ease; }
    .object-table-row:hover { background:var(--accent-soft); }
    .object-detail-shell { display:grid; gap:16px; }
    .object-detail-back { width:max-content; display:inline-flex; align-items:center; gap:7px; color:var(--accent-deep); font-size:13px; font-weight:750; text-decoration:none; }
    .object-detail-hero { display:flex; align-items:center; justify-content:space-between; gap:28px; padding:25px 27px; border:1px solid var(--line); border-radius:18px; background:linear-gradient(125deg,var(--surface) 58%,var(--accent-soft)); box-shadow:var(--shadow); }
    .object-detail-kicker { display:block; margin-bottom:7px; color:var(--accent-deep); font-size:13px; font-weight:850; letter-spacing:.07em; text-transform:uppercase; }
    .object-detail-hero h2 { margin:0; font-size:29px; letter-spacing:-.035em; }
    .object-detail-hero p { margin:7px 0 0; color:var(--muted); font-size:13px; }
    .object-last-update { min-width:190px; padding:12px 15px; border:1px solid color-mix(in srgb,var(--accent) 20%,var(--line)); border-radius:12px; background:color-mix(in srgb,var(--surface) 83%,transparent); }
    .object-last-update span { display:block; color:var(--muted); font-size:13px; font-weight:750; text-transform:uppercase; }
    .object-last-update strong { display:block; margin-top:5px; font-size:13px; font-variant-numeric:tabular-nums; }
    .object-status-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
    .object-status-card { padding:17px 18px; border:1px solid var(--line); border-radius:15px; background:var(--surface); box-shadow:var(--shadow); }
    .object-status-card > span { display:block; margin-bottom:12px; color:var(--muted); font-size:13px; }
    .object-status-card strong { font-size:16px; }
    .object-status-value { display:inline-flex; align-items:center; gap:8px; }
    .object-status-value::before { width:9px; height:9px; border-radius:50%; background:#8b9b94; box-shadow:0 0 0 4px rgba(139,155,148,.12); content:""; }
    .object-status-value.normal { color:#16875d; }
    .object-status-value.normal::before { background:#25b77d; box-shadow:0 0 0 4px rgba(37,183,125,.12); }
    .object-status-value.alarm { color:var(--danger); }
    .object-status-value.alarm::before { background:#ef5b55; box-shadow:0 0 0 4px rgba(239,91,85,.12); }
    .object-status-value.warning { color:#bc7711; }
    .object-status-value.warning::before { background:#e7a328; box-shadow:0 0 0 4px rgba(231,163,40,.12); }
    .object-detail-grid { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(300px,.8fr); gap:16px; }
    .object-detail-card { padding:20px; border:1px solid var(--line); border-radius:16px; background:var(--surface); box-shadow:var(--shadow); }
    .object-detail-card h3 { margin:0 0 15px; font-size:17px; }
    .object-system-list { display:grid; gap:9px; }
    .object-system-row { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:13px 14px; border:1px solid var(--line); border-radius:11px; background:var(--surface-2); }
    .object-system-row span { color:var(--muted); font-size:13px; }
    .object-system-row strong { display:block; margin-top:3px; font-size:14px; }
    .object-action { flex:none; display:inline-flex; align-items:center; justify-content:center; min-height:34px; padding:0 12px; border:0; border-radius:8px; color:var(--accent-deep); background:var(--accent-soft); font:inherit; font-size:13px; font-weight:750; text-decoration:none; cursor:pointer; }
    .object-facts { display:grid; grid-template-columns:1fr 1fr; gap:9px; }
    .object-fact { padding:13px; border:1px solid var(--line); border-radius:11px; background:var(--surface-2); }
    .object-fact span { display:block; color:var(--muted); font-size:13px; }
    .object-fact strong { display:block; margin-top:5px; font-size:18px; }
    .object-sections-card { padding:20px; border:1px solid var(--line); border-radius:16px; background:var(--surface); box-shadow:var(--shadow); }
    .object-sections-head { display:flex; align-items:flex-end; justify-content:space-between; gap:18px; margin-bottom:15px; }
    .object-sections-head h3 { margin:0; font-size:18px; }
    .object-sections-head p { margin:4px 0 0; color:var(--muted); font-size:13px; }
    .object-sections-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:11px; }
    .object-section-tile { min-width:0; min-height:154px; display:flex; flex-direction:column; padding:15px; border:1px solid var(--line); border-radius:13px; color:var(--text); background:var(--surface-2); font:inherit; text-align:left; text-decoration:none; cursor:pointer; transition:border-color .16s ease,background .16s ease,transform .16s ease,box-shadow .16s ease; }
    .object-section-tile:hover { border-color:color-mix(in srgb,var(--accent) 34%,var(--line)); background:color-mix(in srgb,var(--accent-soft) 55%,var(--surface)); box-shadow:0 10px 25px rgba(18,68,48,.08); transform:translateY(-2px); }
    .object-section-tile-top { display:flex; align-items:center; justify-content:space-between; gap:10px; }
    .object-section-icon { width:38px; height:38px; display:grid; place-items:center; border-radius:11px; color:var(--accent-deep); background:var(--accent-soft); }
    .object-section-icon svg { width:21px; height:21px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
    .object-section-arrow { color:var(--muted); font-size:19px; line-height:1; transition:transform .16s ease,color .16s ease; }
    .object-section-tile:hover .object-section-arrow { color:var(--accent-deep); transform:translateX(3px); }
    .object-section-tile h4 { margin:13px 0 0; font-size:15px; }
    .object-section-tile p { margin:4px 0 12px; color:var(--muted); font-size:13px; line-height:1.4; }
    .object-section-meta { display:flex; align-items:baseline; gap:6px; margin-top:auto; }
    .object-section-meta strong { font-size:20px; font-variant-numeric:tabular-nums; }
    .object-section-meta span { overflow:hidden; color:var(--muted); font-size:13px; text-overflow:ellipsis; white-space:nowrap; }
    .object-section-meta b { color:var(--text); font-weight:800; }
    #objectCoordinates { font-size:13px; }
    .object-alerts-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
    .object-alert-card { overflow:hidden; border:1px solid var(--line); border-radius:16px; background:var(--surface); box-shadow:var(--shadow); }
    .object-alert-card header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:17px 19px; border-bottom:1px solid var(--line); }
    .object-alert-card header span { display:block; color:var(--muted); font-size:13px; font-weight:750; text-transform:uppercase; }
    .object-alert-card header h3 { margin:3px 0 0; font-size:16px; }
    .object-alert-card header > strong { min-width:34px; height:34px; display:grid; place-items:center; border-radius:10px; font-size:15px; }
    .object-alert-card.warning header > strong { color:#a76b0a; background:rgba(231,163,40,.13); }
    .object-alert-card.alarm header > strong { color:#c7433c; background:rgba(239,91,85,.12); }
    .object-alert-list { display:grid; }
    .object-alert-item { display:grid; grid-template-columns:auto minmax(0,1fr); gap:11px; padding:13px 19px; border-bottom:1px solid var(--line); }
    .object-alert-item:last-child { border-bottom:0; }
    .object-alert-dot { width:9px; height:9px; margin-top:4px; border-radius:50%; background:#e7a328; box-shadow:0 0 0 4px rgba(231,163,40,.11); }
    .object-alert-card.alarm .object-alert-dot { background:#ef5b55; box-shadow:0 0 0 4px rgba(239,91,85,.1); }
    .object-alert-item strong { display:block; font-size:13px; }
    .object-alert-item span { display:block; margin-top:3px; color:var(--muted); font-size:13px; line-height:1.45; }
    .object-alert-empty { padding:20px; color:var(--muted); font-size:13px; text-align:center; }
    .mono-value { color:#263b32; font-family:"Cascadia Mono","SFMono-Regular",Consolas,monospace; font-size:13px; }
    .reading-value { color:var(--text); font-weight:750; white-space:nowrap; }
    .reading-unit { margin-left:3px; color:var(--muted); font-size:13px; font-weight:500; }
    .quality-cell { min-width:122px; }
    .quality-line { display:flex; align-items:center; justify-content:space-between; gap:8px; color:var(--text); font-weight:750; }
    .quality-line small { color:var(--muted); font-size:13px; font-weight:600; }
    .quality-track { height:5px; margin-top:7px; border-radius:99px; background:#e5ebe8; overflow:hidden; }
    .quality-fill { height:100%; border-radius:inherit; background:#24ae76; }
    .quality-fill.medium { background:#e7a328; }
    .quality-fill.low { background:#de5b52; }
    .loading-row td { padding:32px 15px; color:var(--muted); text-align:center; }
    .apartments-total { margin-left:auto; color:var(--accent-deep); font-size:14px; font-weight:750; }
    .connection { display:inline-flex; align-items:center; gap:6px; white-space:nowrap; }
    .connection::before { content:""; width:7px; height:7px; border-radius:50%; background:#28b178; box-shadow:0 0 0 4px rgba(40,177,120,.1); }
    .connection.offline::before { background:#de5b52; box-shadow:0 0 0 4px rgba(222,91,82,.1); }
    .connection.warning::before { background:#e7a328; box-shadow:0 0 0 4px rgba(231,163,40,.12); }
    .connection.unknown::before { background:#9aa8a1; box-shadow:0 0 0 4px rgba(154,168,161,.12); }
    .count-pill { display:inline-flex; min-width:32px; justify-content:center; padding:5px 8px; border-radius:8px; color:var(--accent-deep); background:var(--accent-soft); font-weight:800; }
    .row-action { width:30px; height:30px; display:grid; place-items:center; border:1px solid var(--line); border-radius:8px; color:var(--muted); background:var(--surface); cursor:pointer; }
    .placeholder { min-height:460px; display:grid; place-items:center; padding:40px; text-align:center; }
    .placeholder-icon { width:58px; height:58px; display:grid; place-items:center; margin:0 auto 18px; border-radius:18px; color:var(--accent); background:var(--accent-soft); font-size:24px; }
    .placeholder h2 { margin:0 0 8px; font-size:22px; }
    .placeholder p { max-width:440px; margin:0; color:var(--muted); font-size:13px; line-height:1.6; }
    .consumption-shell { display:grid; gap:16px; }
    .consumption-head { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; padding:22px 24px; border:1px solid var(--line); border-radius:18px; background:var(--surface); box-shadow:var(--shadow); }
    .consumption-kicker { display:block; margin-bottom:6px; color:var(--accent-deep); font-size:13px; font-weight:800; text-transform:uppercase; letter-spacing:.045em; }
    .consumption-head h2 { margin:0; font-size:27px; letter-spacing:-.03em; }
    .consumption-address { margin:6px 0 0; color:var(--muted); font-size:13px; }
    .consumption-back { display:inline-flex; align-items:center; gap:7px; margin-bottom:10px; color:var(--accent-deep); font-size:13px; font-weight:700; text-decoration:none; }
    .period-switch { display:flex; gap:4px; padding:4px; border:1px solid var(--line); border-radius:11px; background:var(--surface-2); }
    .period-switch button { height:34px; padding:0 14px; border:0; border-radius:8px; color:var(--muted); background:transparent; font:inherit; font-size:13px; font-weight:700; cursor:pointer; }
    .period-switch button.active { color:#fff; background:var(--accent-deep); box-shadow:0 4px 12px rgba(17,99,66,.18); }
    .consumption-period-controls { display:flex; align-items:flex-end; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
    .custom-period { display:flex; align-items:flex-end; gap:6px; padding:4px; border:1px solid var(--line); border-radius:11px; background:var(--surface-2); }
    .custom-period.active { border-color:color-mix(in srgb,var(--accent) 55%,var(--line)); box-shadow:0 0 0 2px color-mix(in srgb,var(--accent-soft) 65%,transparent); }
    .custom-period label { display:grid; gap:2px; }
    .custom-period label span { padding-left:7px; color:var(--muted); font-size:13px; font-weight:800; text-transform:uppercase; }
    .custom-period input { width:132px; height:34px; padding:0 8px; border:1px solid var(--line); border-radius:8px; color:var(--text); background:var(--surface); font:inherit; font-size:13px; font-weight:650; outline:none; }
    .custom-period input:focus { border-color:var(--accent); box-shadow:0 0 0 2px var(--accent-soft); }
    .custom-period button { height:34px; padding:0 13px; border:0; border-radius:8px; color:#fff; background:var(--accent-deep); font:inherit; font-size:13px; font-weight:750; cursor:pointer; }
    .consumption-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
    .consumption-stat { padding:16px 18px; border:1px solid var(--line); border-radius:14px; background:var(--surface); box-shadow:var(--shadow); }
    .consumption-stat span { display:block; color:var(--muted); font-size:13px; }
    .consumption-stat strong { display:block; margin-top:6px; font-size:25px; font-variant-numeric:tabular-nums; }
    .consumption-stat small { color:var(--muted); font-size:13px; }
    .consumption-chart-card { position:relative; min-height:0; padding:18px 20px 12px; border:1px solid var(--line); border-radius:18px; background:var(--surface); box-shadow:var(--shadow); overflow:hidden; }
    .consumption-chart-head { display:flex; align-items:center; justify-content:space-between; gap:15px; margin-bottom:4px; }
    .consumption-chart-head h3 { margin:0; font-size:17px; }
    .consumption-chart-head span { color:var(--muted); font-size:13px; }
    .consumption-chart { width:min(100%,900px); height:auto; min-height:0; display:block; margin:0 auto; overflow:visible; }
    .chart-grid { stroke:#dfe8e3; stroke-width:1; }
    .chart-axis-label { fill:#7b8c84; font:13px "Segoe UI",sans-serif; }
    .maplibregl-ctrl-scale { font-size:13px!important; }
    .chart-area { fill:url(#consumptionGradient); }
    .chart-line { fill:none; stroke:var(--accent); stroke-width:3; stroke-linecap:round; stroke-linejoin:round; }
    .chart-empty { min-height:320px; display:grid; place-items:center; color:var(--muted); text-align:center; }
    .chart-tooltip { position:absolute; z-index:20; display:none; min-width:170px; padding:10px 12px; border-radius:10px; color:#fff; background:#102a4c; box-shadow:0 10px 28px rgba(16,42,76,.28); font-size:13px; line-height:1.55; pointer-events:none; }
    .chart-tooltip.open { display:block; }
    .chart-focus-line { stroke:#4d7261; stroke-width:1; stroke-dasharray:4 4; }
    .chart-focus-dot { fill:#fff; stroke:var(--accent); stroke-width:3; }
    .apartment-charts-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
    .apartment-chart-card { position:relative; min-width:0; padding:16px 17px 0; border:1px solid var(--line); border-radius:16px; background:var(--surface); box-shadow:var(--shadow); overflow:hidden; }
    .apartment-chart-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:2px; }
    .apartment-chart-head span { display:block; color:var(--muted); font-size:13px; font-weight:750; text-transform:uppercase; letter-spacing:.04em; }
    .apartment-chart-head h3 { margin:3px 0 0; font-size:17px; }
    .apartment-chart-unit { padding:6px 8px; border-radius:8px; color:var(--accent-deep); background:var(--accent-soft); font-size:13px; font-weight:800; }
    .apartment-chart-card .consumption-chart { width:100%; }
    .apartment-chart-card .chart-empty { min-height:185px; }
    .apartment-chart-meta { display:grid; grid-template-columns:auto minmax(0,1fr); gap:18px; align-items:center; margin:0 -17px; padding:12px 17px; border-top:1px solid var(--line); background:var(--surface-2); }
    .apartment-chart-reading span { display:block; color:var(--muted); font-size:13px; }
    .apartment-chart-reading strong { display:block; margin-top:3px; font-size:17px; font-variant-numeric:tabular-nums; }
    .apartment-chart-description { margin:0; color:var(--muted); font-size:13px; line-height:1.45; }
    .apartment-devices-section { padding:19px; border:1px solid var(--line); border-radius:16px; background:var(--surface); box-shadow:var(--shadow); }
    .apartment-devices-head { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:14px; }
    .apartment-devices-head h3 { margin:0; font-size:18px; }
    .apartment-devices-head p { margin:4px 0 0; color:var(--muted); font-size:13px; }
    .apartment-devices-count { min-width:34px; height:34px; display:grid; place-items:center; border-radius:10px; color:var(--accent-deep); background:var(--accent-soft); font-size:14px; font-weight:850; }
    .apartment-devices-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
    .apartment-device { padding:15px; border:1px solid var(--line); border-radius:13px; background:var(--surface-2); }
    .apartment-device-top { display:flex; align-items:center; justify-content:space-between; gap:12px; }
    .apartment-device-name { display:flex; align-items:center; gap:11px; min-width:0; }
    .apartment-device-icon { width:42px; height:42px; flex:none; display:grid; place-items:center; margin:0; border-radius:12px; color:var(--accent-deep); background:var(--accent-soft); line-height:0; }
    .apartment-device-icon svg { display:block; width:25px; height:25px; margin:auto; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
    .apartment-device-name strong { display:block; font-size:14px; }
    .apartment-device-name > div > span { display:block; margin-top:3px; color:var(--muted); font-size:13px; }
    .apartment-device-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-top:13px; }
    .apartment-device-field { min-width:0; padding:9px 10px; border:1px solid var(--line); border-radius:9px; background:var(--surface); }
    .apartment-device-field span { display:block; color:var(--muted); font-size:13px; font-weight:750; text-transform:uppercase; }
    .apartment-device-field strong { display:block; margin-top:4px; overflow:hidden; font-size:13px; font-variant-numeric:tabular-nums; text-overflow:ellipsis; white-space:nowrap; }
    .apartment-device-field.converter-field strong { overflow:visible; line-height:1.35; text-overflow:clip; white-space:normal; overflow-wrap:anywhere; }
    .apartment-devices-empty { grid-column:1/-1; padding:24px; color:var(--muted); text-align:center; }
    .overview-live { display:grid; gap:16px; }
    .overview-live .section-heading { margin-bottom:20px; }
    .overview-live .section-heading h2 { font-size:24px; letter-spacing:-.025em; }
    .overview-live .section-heading p { margin-top:6px; font-size:14px; line-height:1.45; }
    .overview-updated { display:inline-flex; align-items:center; gap:9px; color:var(--muted); font-size:13px; }
    .overview-updated::before { content:""; width:7px; height:7px; border-radius:50%; background:var(--accent); box-shadow:0 0 0 4px var(--accent-soft); }
    .overview-main-grid { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(340px,.8fr); gap:16px; }
    .overview-live .metric:has(#overviewIssues),
    .overview-live .overview-events,
    .overview-live .overview-resource-grid > .card:not(.overview-chart-card) { display:none; }
    .overview-live .metrics { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .overview-live .metric { min-height:142px; padding:22px; }
    .overview-live .metric-label { font-size:14px; }
    .overview-live .metric-icon { width:40px; height:40px; border-radius:12px; }
    .overview-live .metric-icon svg { width:21px; height:21px; }
    .overview-live .metric-value { margin-top:10px; font-size:36px; }
    .overview-live .metric-note { margin-left:7px; font-size:13px; }
    .overview-live .trend { margin-top:7px; font-size:13px; line-height:1.35; }
    .overview-live .overview-main-grid,
    .overview-live .overview-resource-grid { grid-template-columns:1fr; }
    .overview-live .overview-main-grid { display:none; }
    .overview-object { overflow:hidden; }
    .overview-object-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:20px; border-bottom:1px solid var(--line); background:linear-gradient(135deg,var(--surface),var(--accent-soft)); }
    .overview-object-head h3 { margin:5px 0 4px; font-size:19px; }
    .overview-object-head p { margin:0; color:var(--muted); font-size:13px; }
    .overview-kicker { color:var(--accent-deep); font-size:13px; font-weight:850; letter-spacing:.1em; text-transform:uppercase; }
    .overview-open { flex:none; padding:9px 12px; border-radius:9px; color:#fff; background:var(--accent-deep); font-size:13px; font-weight:750; text-decoration:none; }
    .overview-system-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); padding:8px 20px 17px; }
    .overview-system { display:grid; grid-template-columns:36px minmax(0,1fr) auto; gap:11px; align-items:center; min-height:66px; padding:10px 8px; border-bottom:1px solid var(--line); }
    .overview-system:nth-last-child(-n+2) { border-bottom:0; }
    .overview-system-icon { width:36px; height:36px; display:grid; place-items:center; border-radius:10px; color:var(--accent-deep); background:var(--accent-soft); }
    .overview-system-icon svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
    .overview-system strong { display:block; font-size:13px; }
    .overview-system span { display:block; margin-top:3px; color:var(--muted); font-size:13px; }
    .overview-status { display:inline-flex!important; align-items:center; gap:6px; margin:0!important; color:var(--accent-deep)!important; font-size:13px!important; font-weight:750; white-space:nowrap; }
    .overview-status::before { content:""; width:7px; height:7px; border-radius:50%; background:var(--accent); }
    .overview-status.warning { color:#a86d05!important; }.overview-status.warning::before { background:var(--warning); }
    .overview-status.alarm,.overview-status.offline { color:var(--danger)!important; }.overview-status.alarm::before,.overview-status.offline::before { background:var(--danger); }
    .overview-events { min-height:0; }
    .overview-events .event-list { padding-bottom:14px; }
    .overview-empty { margin:0 20px 18px; padding:18px; border-radius:11px; color:var(--muted); background:var(--surface-2); font-size:13px; text-align:center; }
    .overview-resource-grid { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(350px,.8fr); gap:16px; }
    .overview-chart-card { overflow:hidden; }
    .overview-chart-card .card-header { padding:22px 24px 17px; }
    .overview-chart-card .card-title h3 { font-size:20px; }
    .overview-chart-card .card-title p { margin-top:6px; font-size:13px; line-height:1.4; }
    .overview-resource-values { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; padding:0 20px 12px; }
    .overview-chart-card .card-header > .link,
    .overview-resource-value:has(#overviewHeatDay),
    .overview-chart-card .overview-live-chart { display:none; }
    .overview-resource-values { grid-template-columns:repeat(3,minmax(0,1fr)); padding-bottom:20px; }
    .overview-resource-value { min-height:84px; padding:16px 18px; border:1px solid var(--line); border-radius:12px; background:var(--surface-2); }
    .overview-resource-value span { display:block; color:var(--muted); font-size:13px; }
    .overview-resource-value strong { display:block; margin-top:8px; font-size:25px; font-variant-numeric:tabular-nums; }
    .overview-resource-value small { margin-left:5px; color:var(--muted); font-size:13px; font-weight:600; }
    .overview-live-chart { display:block; width:100%; height:150px; padding:0 20px 18px; overflow:visible; }
    .overview-live-chart .chart-grid { stroke:var(--line); stroke-width:1; }
    .overview-live-chart .chart-area { fill:var(--accent-soft); }
    .overview-live-chart .chart-line { fill:none; stroke:var(--accent); stroke-width:2.5; stroke-linecap:round; stroke-linejoin:round; }
    .overview-live-chart text { fill:var(--muted); font-size:13px; }
    .overview-converters { padding:0 20px 15px; }
    .overview-converter { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; align-items:center; padding:10px 0; border-top:1px solid var(--line); }
    .overview-converter strong { display:block; font-size:13px; }.overview-converter span { color:var(--muted); font-size:13px; }
    .overview-converter-value { text-align:right; }.overview-converter-value b { display:block; color:var(--accent-deep); font-size:13px; }
    @media (max-width:1100px) { .overview-main-grid,.overview-resource-grid { grid-template-columns:1fr; } }
    @media (max-width:700px) { .overview-system-grid,.overview-resource-values { grid-template-columns:1fr 1fr; }.overview-system:nth-last-child(-n+2) { border-bottom:1px solid var(--line); } }
    @media (max-width:480px) { .overview-system-grid,.overview-resource-values { grid-template-columns:1fr; }.overview-object-head { flex-direction:column; }.overview-open { width:100%; text-align:center; } }
    @media (max-width:760px) {
      .overview-grid .event-list { grid-template-columns:1fr; }
      .registry-head { align-items:stretch; flex-direction:column; }
      .registry-actions { align-items:stretch; flex-direction:column; }
      .registry-search { width:100%; }
      .registry-stats { grid-template-columns:repeat(2,1fr); }
      .object-detail-hero { align-items:flex-start; flex-direction:column; }
      .object-last-update { width:100%; }
      .object-status-grid, .object-detail-grid, .object-alerts-grid { grid-template-columns:1fr; }
      .object-sections-grid { grid-template-columns:1fr 1fr; }
      .consumption-head { align-items:stretch; flex-direction:column; }
      .consumption-period-controls { align-items:stretch; justify-content:stretch; }
      .period-switch { width:100%; }
      .period-switch button { flex:1; }
      .custom-period { width:100%; }
      .custom-period label { flex:1; }
      .custom-period input { width:100%; }
      .consumption-stats { grid-template-columns:1fr; }
      .consumption-chart-card { padding-left:10px; padding-right:10px; }
      .apartment-charts-grid { grid-template-columns:1fr; }
      .apartment-devices-grid { grid-template-columns:1fr; }
      .apartment-device-fields { grid-template-columns:1fr 1fr; }
      .page-map-shell { height:calc(100vh - 70px); min-height:520px; }
      .map-floating-title { top:12px; left:12px; min-width:0; max-width:calc(100% - 80px); }
      .map-floating-legend { right:12px; bottom:12px; }
      .map-data-source { display:none; }
    }
    @media (max-width:520px) {
      .object-sections-grid { grid-template-columns:1fr; }
    }
    
