:root {
      color-scheme: light;
      --bg: #f4f7f5;
      --surface: #ffffff;
      --surface-2: #f8faf9;
      --surface-3: #eef3f0;
      --text: #17221d;
      --muted: #718079;
      --line: #e1e8e4;
      --accent: #1d8a61;
      --accent-deep: #116342;
      --accent-soft: #e1f4eb;
      --warning: #e7a328;
      --warning-soft: #fff3d7;
      --danger: #dd5d55;
      --danger-soft: #ffebe8;
      --info: #4d7fe8;
      --shadow: 0 10px 34px rgba(35, 62, 49, .07);
      --sidebar: #173c2f;
      --sidebar-muted: #9db3aa;
    }

    * { 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: #56d19a; box-shadow: inset 0 -8px 18px rgba(0,0,0,.1); }
    .brand-mark::before, .brand-mark::after { content: ""; position: absolute; background: #123c2c; 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: 11px; }
    .nav-label { padding: 9px 12px 8px; color: #718f83; font-size: 10px; font-weight: 800; letter-spacing: .12em; 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(97, 216, 162, .16); }
    .nav-item.active .icon { color: #66d9a5; }
    .icon { width: 19px; height: 19px; display: grid; place-items: center; color: #819c91; }
    .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: 11px; 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:11px; 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:11px; }
    .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,#2b9d70,#176448); font-weight:750; font-size:12px; }

    .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:11px; }
    .link { color:var(--accent-deep); font-weight:700; font-size:11px; 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:11px; }
    .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:10px; font-weight:500; }
    .trend { display:inline-flex; align-items:center; gap:4px; margin-top:4px; color:var(--accent); font-size:10px; 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:10px; }
    .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:9px; 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:10px; 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:9px; }
    .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:11px; }
    .event p { margin:0; color:var(--muted); font-size:9px; line-height:1.45; }
    .event time { color:var(--muted); font-size:9px; 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:10px; 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:9px; }
    .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:8px; }
    .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:10px; }
    .zone span { color:var(--muted); font-size:9px; }
    .zone-value { text-align:right; }
    .zone-value b { display:block; font-size:10px; }

    .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:12px; 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:8px; 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:11px; 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:10px; }
    .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:9px; }
    .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:12px; }
    .building-status-value { display:inline-flex; align-items:center; gap:8px; color:var(--text); font-size:12px; 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:12px; }
    .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:11px; }
    .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:11px; 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:12px; }
    .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(1120px,100%); max-height:min(850px,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 24px 24px; }
    .apartment-columns, .apartment-row { min-width:720px; display:grid; grid-template-columns:minmax(170px,1fr) repeat(5,86px); gap:8px; align-items:center; }
    .apartment-columns { position:sticky; top:0; z-index:2; padding:9px 12px 7px; color:var(--muted); background:var(--surface); font-size:12px; font-weight:700; letter-spacing:0; text-align:center; }
    .apartment-columns span:first-child { text-align:left; }
    .floor-group { min-width:720px; margin-top:7px; border:1px solid var(--line); border-radius:11px; background:var(--surface); overflow:visible; }
    .floor-title { padding:7px 13px; color:var(--accent-deep); background:var(--accent-soft); font-size:13px; font-weight:700; letter-spacing:0; }
    .apartment-row { padding:7px 12px; border-top:1px solid var(--line); }
    .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:24px; border-radius:7px; color:#405048; background:var(--surface-3); font-size:13px; font-weight:550; font-variant-numeric:tabular-nums; cursor:help; }
    .meter-zero:hover { color:var(--accent-deep); background:var(--accent-soft); }
    .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:#173c2f; box-shadow:0 8px 22px rgba(14,45,32,.22); font-size:11px; 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:#173c2f; 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); }
    @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:10px; }
    .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:12px; }
    .registry-stat strong { display:block; margin-top:7px; font-size:27px; letter-spacing:-.03em; }
    .registry-stat small { color:var(--accent-deep); font-size:11px; font-weight:700; }
    .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:11px; 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:11px; 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; }
    .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:11px; }
    .object-link { color:var(--text); text-decoration:none; }
    .object-link:hover { color:var(--accent-deep); text-decoration:underline; text-underline-offset:3px; }
    .mono-value { color:#263b32; font-family:"Cascadia Mono","SFMono-Regular",Consolas,monospace; font-size:12px; }
    .reading-value { color:var(--text); font-weight:750; white-space:nowrap; }
    .reading-unit { margin-left:3px; color:var(--muted); font-size:11px; 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:10px; 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:12px; line-height:1.6; }
    @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); }
      .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; }
    }
    
