/* HOR EMS design (approved by the owner 03.11.2026, mockup projects/SCADA/знімки/redesign-hor/HOR-REDESIGN.html).
   The language of the HOR Energy investment offer: bold black page title left, HOR logo right, flat grey panels #D9D9D9
   with big round corners and white cards inside, big orange numbers only on white cards (44 px and more), dark grey
   #808080 for rings and inactive marks, section blocks with pictograms (active block solid orange).
   Unchanged rules: orange = selected or main action; states ● norm, ▲ warning, ■ alarm, grey dashed = no data;
   ДЕМО black everywhere; 3 px black focus ring; 44 px touch targets. Loaded after app/pages/ems.css. */

html:not([data-theme="dark"]) {
  --g: #d9d9d9; --gd: #808080; --gl: #ededed; --or: #f49415; --ink: #000; --mut: #4d4d4d; --s-ok: #1b7a44; --s-al: #b3261e;
  --panel: #d9d9d9; --card: #fff; --text: #000; --muted: #4d4d4d; --dim: #4d4d4d; --line: #fff; --line2: #b3b3b3;
}
html:not([data-theme="dark"]) body { background: #fff; color: #000; font-family: "Montserrat", system-ui, sans-serif; font-size: 15px; font-weight: 500; line-height: 1.45; }
.s-ok { color: var(--s-ok); } .s-al { color: var(--s-al); } .s-warn { color: #8a6200; }

/* ---------- header ---------- */
html:not([data-theme="dark"]) .top.hd { position: static; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 28px;
  padding: 28px 40px 0; min-height: 0; background: #fff; border: 0; box-shadow: none; backdrop-filter: none; }
.hd .phmark { display: none; }
.hd .ttl { min-width: 0; flex: 0 1 auto; }
.hd .ttl h1 { margin: 0; font-size: 40px; line-height: 1.05; font-weight: 800; letter-spacing: -.8px; color: #000; }
.hd .sitepick { position: relative; margin-top: 10px; }
html:not([data-theme="dark"]) .hd .obj { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; max-width: 640px; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: #000; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html:not([data-theme="dark"]) .hd .obj::after { content: none; }
.hd .obj .k { font-weight: 500; color: var(--mut); }
.hd .obj svg.i { width: 18px; height: 18px; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hd .st { margin-left: auto; display: flex; align-items: center; gap: 10px; padding-top: 4px; flex-wrap: nowrap; }
html:not([data-theme="dark"]) .hd .blk { display: inline-flex; align-items: center; gap: 9px; height: 44px; padding: 0 16px; border-radius: 14px;
  background: var(--g); color: #000; font-size: 13px; font-weight: 600; white-space: nowrap; text-decoration: none; border: 0; width: auto; }
.hd .blk small { font-weight: 500; color: var(--mut); font-size: 12px; }
html:not([data-theme="dark"]) .hd .blk.demo { background: #000; color: #fff; font-weight: 800; letter-spacing: .06em; }
html:not([data-theme="dark"]) .hd .blk.demo small { color: #fff; opacity: .9; letter-spacing: 0; }
html:not([data-theme="dark"]) .hd .blk.readonly { background: #fff; border: 1px solid #000; }
html:not([data-theme="dark"]) .hd .blk.alarm, html:not([data-theme="dark"]) .hd .alarmcount.on { background: var(--s-al); color: #fff; font-weight: 800; }
html:not([data-theme="dark"]) .hd .blk.bad { background: var(--s-al); color: #fff; }
html:not([data-theme="dark"]) .hd .blk.bad small { color: #fff; }
html:not([data-theme="dark"]) .hd .link { width: 9px; height: 9px; border-radius: 50%; background: var(--s-ok); box-shadow: none; }
html:not([data-theme="dark"]) .hd .link.down { background: #fff; border-radius: 1px; }
html:not([data-theme="dark"]) .hd .blk.time { flex-direction: column; align-items: flex-end; justify-content: center; gap: 0; line-height: 1; background: transparent; padding: 0 6px; }
html:not([data-theme="dark"]) .hd .blk.time b { font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
html:not([data-theme="dark"]) .hd .blk.time small { margin-top: 3px; display: block; }
.hd .usermenu { position: relative; }
html:not([data-theme="dark"]) .hd .ava { width: 44px; height: 44px; min-height: 44px; max-width: none; border-radius: 50%; background: var(--g); color: #000;
  display: grid; place-items: center; font: inherit; font-weight: 800; font-size: 13px; border: 0; padding: 0; cursor: pointer; }
html:not([data-theme="dark"]) .hd .logo { flex: none; display: block; height: auto; margin: -2px 0 0 8px; text-decoration: none; }
.hd .logo img { display: block; height: 60px; width: auto; }
/* section blocks */
html:not([data-theme="dark"]) .hd .nav { order: 9; flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 26px; padding: 0;
  height: auto; overflow: visible; border: 0; }
html:not([data-theme="dark"]) .hd .nav a { display: inline-flex; align-items: center; gap: 10px; height: 52px; min-height: 52px; padding: 0 18px 0 14px; margin: 0;
  border-radius: 16px; border: 0; background: var(--g); color: #000; text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap; }
html:not([data-theme="dark"]) .hd .nav a svg.i { width: 22px; height: 22px; }
html:not([data-theme="dark"]) .hd .nav a.on { background: var(--or); color: #000; font-weight: 800; border: 0; }
.bd { position: relative; display: inline-flex; }
.bd em { position: absolute; top: -10px; right: -12px; font-style: normal; background: var(--s-al); color: #fff; font-size: 10px; font-weight: 800; border-radius: 7px; padding: 1px 5px; line-height: 1.2; }
.bd em[hidden] { display: none; }
/* dropdowns */
html:not([data-theme="dark"]) .hd .sitemenu, html:not([data-theme="dark"]) .hd .umenu { background: #fff; border: 0; border-radius: 20px;
  box-shadow: 0 0 0 1px #d9d9d9, 0 18px 40px rgba(0, 0, 0, .12); padding: 8px; z-index: 60; }
html:not([data-theme="dark"]) .hd .umenu { right: 0; left: auto; min-width: 260px; }
.hd .umenu .who { padding: 8px 10px 10px; border-bottom: 1px solid #d9d9d9; margin-bottom: 6px; }
.hd .umenu a, .hd .umenu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 12px;
  background: none; color: #000; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; text-align: left; }
.hd .umenu button { background: var(--or); margin-top: 6px; font-weight: 800; }
.hd .umenu a:hover { background: var(--gl); }

/* ---------- page layout, panels, cards ---------- */
html:not([data-theme="dark"]) .wrap { max-width: none; padding: 0 40px 48px; display: flex; flex-direction: column; gap: 20px; }
html:not([data-theme="dark"]) .wrap > * { margin-top: 0; margin-bottom: 0; }
html:not([data-theme="dark"]) .panel { background: var(--g); border: 0; border-radius: 28px; box-shadow: none; padding: 26px 30px 28px; }
html:not([data-theme="dark"]) .panel .panel, html:not([data-theme="dark"]) .panel .card { background: #fff; border-radius: 20px; padding: 18px 20px; }
html:not([data-theme="dark"]) .phead { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 0 0 18px; }
html:not([data-theme="dark"]) .phead h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.3px; color: #000; text-transform: none; }
html:not([data-theme="dark"]) .phead .hint { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--mut); }
html:not([data-theme="dark"]) .phead a { font-size: 13px; font-weight: 700; }
html:not([data-theme="dark"]) .grid, html:not([data-theme="dark"]) .ctlgrid, html:not([data-theme="dark"]) .stack { gap: 20px; }
html:not([data-theme="dark"]) .tbl th { background: transparent; color: #000; font-weight: 800; font-size: 13px; border-bottom: 2px solid #fff; }
html:not([data-theme="dark"]) .tbl td { border-bottom: 1px solid #fff; font-size: 13px; }
html:not([data-theme="dark"]) .panel .panel .tbl th, html:not([data-theme="dark"]) .panel .panel .tbl td { border-bottom-color: var(--g); }
html:not([data-theme="dark"]) .scroll { background: none; }

/* KPI: grey panel with white cards, big orange numbers on white */
.kpiwrap .kpis, .kpiwrap .mkpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin: 0; }
.kpiwrap .mkpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
html:not([data-theme="dark"]) .kpiwrap .kpi { background: #fff; border-radius: 20px; padding: 18px 20px; min-height: 0; }
html:not([data-theme="dark"]) .kpi .lbl { font-size: 14px; font-weight: 700; color: #000; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; line-height: 1.2; }
html:not([data-theme="dark"]) .kpi .val { font-size: 52px; font-weight: 800; letter-spacing: -1.5px; line-height: 1; margin: 12px 0 8px; color: var(--or); }
html:not([data-theme="dark"]) .kpi .val small { font-size: 16px; font-weight: 700; letter-spacing: 0; margin-left: 5px; color: #000; white-space: nowrap; }
html:not([data-theme="dark"]) .kpi .val .dev, html:not([data-theme="dark"]) .kpi .val .dev.okv { color: var(--or); font-weight: 800; }
html:not([data-theme="dark"]) .kpi .val .nodata { color: #000; font-size: 22px; letter-spacing: 0; }
html:not([data-theme="dark"]) .kpi .sub { font-size: 12px; color: var(--mut); line-height: 1.35; }
html:not([data-theme="dark"]) .kpi .bar { height: 10px; border-radius: 999px; background: var(--g); margin-top: 12px; border: 0; }
html:not([data-theme="dark"]) .kpi .bar i { background: var(--or); border-radius: 999px; }
html:not([data-theme="dark"]) .kpi .chip { background: var(--g); color: #000; border: 0; border-radius: 999px; padding: 1px 9px; font-size: 11px; font-weight: 700; }
html:not([data-theme="dark"]) .kpi .chip.demo { background: #000; color: #fff; }
html:not([data-theme="dark"]) .kpi .chip.discharge { background: #000; color: #fff; }

/* buttons, segments, inputs */
html:not([data-theme="dark"]) .btn { min-height: 44px; border-radius: 14px; border: 0; background: #fff; color: #000; font: inherit; font-weight: 700; font-size: 14px; padding: 0 18px; }
html:not([data-theme="dark"]) .btn.sm { min-height: 36px; border-radius: 999px; border: 2px solid #000; background: #fff; padding: 0 14px; font-size: 12px; }
html:not([data-theme="dark"]) .btn.primary { background: var(--or); color: #000; font-weight: 800; border: 0; }
html:not([data-theme="dark"]) .btn.danger { background: var(--s-al); color: #fff; font-weight: 800; }
html:not([data-theme="dark"]) .btn.ghost { background: transparent; border: 2px solid #000; }
html:not([data-theme="dark"]) .seg, html:not([data-theme="dark"]) .tabs { display: inline-flex; gap: 6px; background: #fff; border-radius: 14px; padding: 4px; border: 0; }
html:not([data-theme="dark"]) .seg button, html:not([data-theme="dark"]) .tabs button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; color: #000; font: inherit; font-size: 13px; font-weight: 600; }
html:not([data-theme="dark"]) .seg button.on, html:not([data-theme="dark"]) .tabs button.on, html:not([data-theme="dark"]) .cardtabs button.on,
html:not([data-theme="dark"]) .pagetabs button.on { background: var(--or); color: #000; font-weight: 800; border: 0; }
html:not([data-theme="dark"]) .field input, html:not([data-theme="dark"]) .field textarea, html:not([data-theme="dark"]) select, html:not([data-theme="dark"]) .search {
  background-color: #fff; border: 2px solid transparent; border-radius: 14px; min-height: 44px; font-weight: 600; box-shadow: inset 0 0 0 1px #808080; }
html:not([data-theme="dark"]) .field label { font-size: 12px; font-weight: 600; color: var(--mut); }
html:not([data-theme="dark"]) .toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: none; padding: 0; }

/* banners: black strip with an orange ДЕМО badge, as in the mockup */
html:not([data-theme="dark"]) .banner, html:not([data-theme="dark"]) .banner.demo { display: block; background: #000; color: #fff; border-radius: 18px; padding: 14px 20px; font-size: 13px; border: 0; }
html:not([data-theme="dark"]) .banner b:first-child::before, html:not([data-theme="dark"]) .banner.demo b:first-child::before {
  content: "ДЕМО"; display: inline-block; background: var(--or); color: #000; border-radius: 999px; padding: 3px 12px; margin-right: 12px; font-weight: 800; letter-spacing: .05em; }
html:not([data-theme="dark"]) .banner a { color: #fff; }

/* ---------- control panel (mockup «Пульт») ---------- */
html:not([data-theme="dark"]) .ctlbar { display: grid; grid-template-columns: 1.4fr 1fr 1.4fr .8fr .7fr .8fr; gap: 10px; padding: 16px 20px; }
html:not([data-theme="dark"]) .ctlbar > div { background: #fff; border-radius: 16px; padding: 12px 16px; line-height: 1.2; }
html:not([data-theme="dark"]) .ctlbar small { display: block; font-size: 11px; color: var(--mut); margin-bottom: 5px; font-weight: 600; }
html:not([data-theme="dark"]) .ctlbar b, html:not([data-theme="dark"]) .ctlbar .ownerline b { font-size: 14px; font-weight: 800; }
html:not([data-theme="dark"]) .scopeseg { background: none; padding: 0; gap: 8px; }
html:not([data-theme="dark"]) .scopeseg button { min-height: 44px; border: 0; border-radius: 14px; background: #fff; color: #000; font-weight: 700; font-size: 14px; padding: 0 18px; }
html:not([data-theme="dark"]) .scopeseg button.on { background: var(--or); font-weight: 800; }
html:not([data-theme="dark"]) .scopeseg button:disabled { color: var(--mut); border: 2px dashed var(--gd); background: transparent; font-weight: 600; }
html:not([data-theme="dark"]) .nowmode { font-size: 14px; }
html:not([data-theme="dark"]) .modes { gap: 12px; }
html:not([data-theme="dark"]) .modes .modecard { background: #fff; border-radius: 18px; padding: 16px 16px 14px; min-height: 150px; }
html:not([data-theme="dark"]) .modes .modecard.on { background: var(--or); }
html:not([data-theme="dark"]) .modes .modecard .btn.sm { border: 2px solid #000; }
html:not([data-theme="dark"]) #dir { background: none; padding: 0; gap: 8px; display: flex; }
html:not([data-theme="dark"]) #dir button { flex: 1; align-items: flex-start; text-align: left; border: 0; border-radius: 14px; background: #fff; color: #000; padding: 10px 14px; font-size: 14px; font-weight: 700; }
html:not([data-theme="dark"]) #dir button small { font-weight: 500; color: var(--mut); }
html:not([data-theme="dark"]) #dir button.on { background: var(--or); color: #000; }
html:not([data-theme="dark"]) #dir button.on small { color: #000; }
html:not([data-theme="dark"]) .manual .field input, html:not([data-theme="dark"]) #m-mw, html:not([data-theme="dark"]) #m-min { font-size: 20px; font-weight: 800; }
html:not([data-theme="dark"]) .sendbtn { border-radius: 16px; min-height: 52px; font-size: 15px; }
html:not([data-theme="dark"]) .zerobtn { border-radius: 14px; border: 2px solid #000 !important; }
html:not([data-theme="dark"]) .actions .btn:not(.zerobtn) { background: #fff; }
html:not([data-theme="dark"]) .planbox { background: #fff; border-radius: 20px; padding: 18px 20px; border: 0; }
html:not([data-theme="dark"]) .secstate .panel { background: #fff; }
html:not([data-theme="dark"]) .secflow { font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
html:not([data-theme="dark"]) .why p { font-size: 13px; }

/* modal */
html:not([data-theme="dark"]) .modal .box { border-radius: 28px; border: 0; padding: 26px 28px; background: #fff; }
html:not([data-theme="dark"]) .modal .box h3 { font-size: 22px; font-weight: 800; margin: 0 0 12px; }

/* numbered orange steps (import, command life cycle) */
.stepper { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 12px; color: var(--mut); }
.stepper i { width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--or); display: inline-grid; place-items: center; font-style: normal; font-weight: 800; color: #000; font-size: 11px; margin-right: 6px; }

/* login */
html:not([data-theme="dark"]) .loginpage { background: #fff; display: grid; place-items: center; min-height: 100vh; }
html:not([data-theme="dark"]) .loginbox { background: var(--g); border-radius: 32px; padding: 36px 36px 30px; box-shadow: none; width: min(440px, calc(100% - 32px)); }
html:not([data-theme="dark"]) .loginbox .btn.primary { width: 100%; min-height: 52px; border-radius: 16px; font-size: 16px; }
html:not([data-theme="dark"]) .loginlogo small { font-weight: 600; color: var(--mut); }
html:not([data-theme="dark"]) .loginlogo .demotag { background: #000; color: #fff; border-radius: 14px; padding: 8px 14px; font-weight: 800; }

/* phone bottom tab bar and «Ще» sheet */
.bottomnav.tab { display: none; }
.moresheet[hidden] { display: none !important; }

@media (max-width: 1500px) {
  html:not([data-theme="dark"]) .hd .nav a { padding: 0 14px 0 12px; gap: 8px; font-size: 13px; }
  .kpiwrap .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  html:not([data-theme="dark"]) .ctlbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .hd .logo { display: none !important; }
  .kpiwrap .mkpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  html:not([data-theme="dark"]) body { padding-bottom: 96px; font-size: 14px; }
  /* 64 px bar: mark, title + object, ДЕМО, alarms, user; a thin status line under it */
  html:not([data-theme="dark"]) .top.hd { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto auto auto; grid-template-rows: 64px auto;
    align-items: center; gap: 0 8px; padding: 0 12px 4px; }
  .hd .phmark { display: block; grid-row: 1; grid-column: 1; }
  .hd .phmark img { width: 32px; height: 32px; display: block; }
  .hd .ttl { grid-row: 1; grid-column: 2; }
  .hd .ttl h1 { font-size: 22px; letter-spacing: -.4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hd .sitepick { margin-top: 2px; position: static; }
  html:not([data-theme="dark"]) .hd .obj { font-size: 11px; max-width: 100%; min-height: 20px; }
  .hd .obj .k { display: none; }
  .hd .st { display: contents; }
  html:not([data-theme="dark"]) .hd .blk { height: 32px; padding: 0 10px; font-size: 11px; border-radius: 10px; }
  html:not([data-theme="dark"]) .hd .blk.demo small { display: none; }
  #demo { grid-row: 1; grid-column: 3; }
  #readonly { grid-row: 1; grid-column: 3; }
  #alarmcount { grid-row: 1; grid-column: 4; }
  .hd .usermenu { grid-row: 1; grid-column: 5; }
  html:not([data-theme="dark"]) .hd .ava { width: 34px; height: 34px; min-height: 34px; font-size: 11px; }
  #linkpill { grid-row: 2; grid-column: 1 / 4; justify-self: start; }
  html:not([data-theme="dark"]) .hd .blk.time { grid-row: 2; grid-column: 4 / 6; justify-self: end; flex-direction: row; align-items: baseline; gap: 4px; height: 24px; }
  html:not([data-theme="dark"]) .hd .blk.time b { font-size: 13px; }
  html:not([data-theme="dark"]) .hd .blk.time small { margin: 0; font-size: 10px; }
  .hd .logo, html:not([data-theme="dark"]) .hd .nav { display: none !important; }
  html:not([data-theme="dark"]) .hd .sitemenu { left: 12px; right: 12px; width: auto; }
  html:not([data-theme="dark"]) .wrap { padding: 8px 12px 24px; gap: 10px; }
  html:not([data-theme="dark"]) .panel { border-radius: 22px; padding: 16px; }
  html:not([data-theme="dark"]) .phead h2 { font-size: 17px; }
  .kpiwrap .kpis, .kpiwrap .mkpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  html:not([data-theme="dark"]) .kpiwrap .kpi { padding: 14px; }
  html:not([data-theme="dark"]) .ctlbar { grid-template-columns: 1fr 1fr; }
  .bottomnav.tab { display: grid; position: fixed; z-index: 50; left: 10px; right: 10px; bottom: 10px; height: 66px; background: var(--g); border-radius: 22px;
    grid-template-columns: repeat(5, 1fr); padding: 6px; gap: 4px; border: 0; }
  .bottomnav.tab > a, .bottomnav.tab > button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 16px;
    text-decoration: none; font: inherit; font-size: 10.5px; font-weight: 600; color: #000; background: none; border: 0; min-height: 44px; padding: 0; }
  .bottomnav.tab svg.i { width: 22px; height: 22px; }
  .bottomnav.tab > .on { background: var(--or); font-weight: 800; }
  .bottomnav.tab .bd em { top: -5px; right: -12px; font-size: 9px; }
  .moresheet { position: fixed; z-index: 45; inset: 0 0 86px; background: #fff; padding: 16px 12px; overflow: auto; }
  .moresheet h2 { font-size: 22px; font-weight: 800; margin: 0 0 12px; }
  .moresheet .mg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .moresheet .mg a { display: flex; flex-direction: column; justify-content: space-between; height: 96px; background: var(--g); border-radius: 20px; padding: 14px;
    color: #000; text-decoration: none; font-weight: 700; font-size: 14px; }
  .moresheet .mg a svg.i { width: 26px; height: 26px; }
  .moresheet .mg a.on { background: var(--or); font-weight: 800; }
  .moresheet .usr { display: flex; align-items: center; gap: 12px; background: var(--g); border-radius: 20px; padding: 12px 14px; margin-top: 10px; }
  .moresheet .usr .ava { width: 40px; height: 40px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; }
  .moresheet .usr b { display: block; font-size: 14px; }
  .moresheet .usr small { display: block; font-size: 11px; color: var(--mut); }
  .moresheet .usr .lk { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .moresheet .usr .lk a, .moresheet .usr .lk button { background: #fff; border: 0; border-radius: 999px; padding: 0 12px; min-height: 36px; display: inline-flex; align-items: center;
    font: inherit; font-size: 12px; font-weight: 700; color: #000; text-decoration: none; }
}

html:not([data-theme="dark"]) .hd .logo { width: auto; background: none; border-radius: 0; display: block; }
/* data colours as in the approved mockup: grid and plant black, sun orange, battery dark grey (direction always in words) */
html:not([data-theme="dark"]) { --grid: #000; --load: #000; --pv: #f49415; --bess: #808080; --charge: #4d4d4d; --soc: #f49415; --plan: #4d4d4d; }
html:not([data-theme="dark"]) .socfill { fill: var(--or); }
html:not([data-theme="dark"]) .grid > .side, html:not([data-theme="dark"]) .side { align-content: start; align-self: start; }
.side > .panel { height: auto; }
html:not([data-theme="dark"]) { --s-ok: #0e6a3f; }
html:not([data-theme="dark"]) .wrap > *, html:not([data-theme="dark"]) .wizard, 
html:not([data-theme="dark"]) .sheetprev, html:not([data-theme="dark"]) #w-preview { overflow: auto; max-width: 100%; }
/* manual control: direction on its own row, then power and duration side by side, then what happens after */
html:not([data-theme="dark"]) .manual { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 16px; align-items: start; }
html:not([data-theme="dark"]) .manual > .field:first-child, html:not([data-theme="dark"]) .manual > .field.wide { grid-column: 1 / -1; }
@media (max-width: 600px) { html:not([data-theme="dark"]) .manual { grid-template-columns: 1fr; } }

.stepper { margin: 0 0 16px; font-size: 13px; color: #000; }
.stepper span { display: inline-flex; align-items: center; font-weight: 600; opacity: .55; }
.stepper span.on, .stepper span.done { opacity: 1; }
.stepper span.on { font-weight: 800; }
.stepper span.done i::after { content: "✓"; }
.stepper span.done i { font-size: 0; }
.stepper span.done i::after { font-size: 12px; }
/* owner 03.11: the object picker sits in the first row right of the page title (one row less in the header) */
@media (min-width: 761px) {
  html:not([data-theme="dark"]) .top.hd { align-items: center; }
  .hd .ttl { display: flex; align-items: center; gap: 22px; flex: 1 1 auto; min-width: 0; }
  .hd .ttl h1 { flex: none; }
  .hd .sitepick { margin-top: 0; min-width: 0; flex: 0 1 auto; }
  html:not([data-theme="dark"]) .hd .obj { max-width: 100%; display: flex; }
  html:not([data-theme="dark"]) .hd .obj #sitename { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hd .st { padding-top: 0; }
  html:not([data-theme="dark"]) .hd .logo { margin-top: 0; }
}
@media (min-width: 761px) {
  html:not([data-theme="dark"]) .top.hd { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; column-gap: 24px; }
  .hd .ttl { grid-column: 1; grid-row: 1; }
  .hd .st { grid-column: 2; grid-row: 1; margin-left: 0; }
  html:not([data-theme="dark"]) .hd .logo { grid-column: 3; grid-row: 1; margin-left: 0; }
  html:not([data-theme="dark"]) .hd .nav { grid-column: 1 / -1; grid-row: 2; }
}
@media (min-width: 761px) and (max-width: 1100px) { html:not([data-theme="dark"]) .top.hd { grid-template-columns: minmax(0, 1fr) auto; } }
/* owner 03.11: no orange stripe on rounded selected rows (it looked like a bracket); selected = light grey row + ✓ */
html:not([data-theme="dark"]) .sitemenu li.on, html:not([data-theme="dark"]) .tree li.sel > .tnode { box-shadow: none; background: #ededed; border-radius: 12px; }
html:not([data-theme="dark"]) .sitemenu li { border-radius: 12px; }
html:not([data-theme="dark"]) .sitemenu li.on b::after, html:not([data-theme="dark"]) .tree li.sel > .tnode .tname > b::after { content: " ✓"; font-weight: 800; }
html:not([data-theme="dark"]) .issues li { border-left: 0; border-radius: 12px; padding-left: 28px; position: relative; }
html:not([data-theme="dark"]) .issues li::before { content: "▲"; position: absolute; left: 10px; }
html:not([data-theme="dark"]) .issues li.error::before { content: "■"; color: var(--s-al); }
html:not([data-theme="dark"]) a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: #000; }
html:not([data-theme="dark"]) .toolbar .field { margin: 0; }

/* owner 03.11: logo back on the left. Row 1 = logo | title + object | status; the object name gives way first,
   then (1280 px and less) the logo shows only the HOR sign without the caption. */
.hd .logo .mark { display: none; }
@media (min-width: 761px) {
  html:not([data-theme="dark"]) .top.hd { grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 28px; }
  html:not([data-theme="dark"]) .hd .logo { grid-column: 1; grid-row: 1; margin: 0; }
  .hd .ttl { grid-column: 2; grid-row: 1; }
  .hd .st { grid-column: 3; grid-row: 1; }
}
@media (min-width: 761px) and (max-width: 1100px) { html:not([data-theme="dark"]) .top.hd { grid-template-columns: auto minmax(0, 1fr) auto; } }
@media (max-width: 1280px) {
  .hd .logo .full { display: none; }
  .hd .logo .mark { display: block; height: 40px; width: auto; }
  .hd .logo { display: block !important; }
  .hd .ttl h1 { font-size: 32px; }
  html:not([data-theme="dark"]) .hd .blk { padding: 0 12px; }
}
@media (max-width: 1100px) {
  html:not([data-theme="dark"]) .hd .blk.demo small, html:not([data-theme="dark"]) .hd #linktext small { display: none; }
  .hd .ttl { gap: 14px; }
}
@media (max-width: 760px) {
  .hd .logo { display: none !important; }
  html:not([data-theme="dark"]) .top.hd { grid-template-columns: 56px minmax(0, 1fr) auto auto auto; }
  .hd .phmark img { width: 56px; height: auto; }
}

/* owner 03.11: section blocks fill the whole row, equal width, icon and name centred; never cut */
html:not([data-theme="dark"]) .hd .nav { flex-wrap: nowrap; }
html:not([data-theme="dark"]) .hd .nav a { flex: 1 1 0; min-width: 0; justify-content: center; padding: 0 10px; }
html:not([data-theme="dark"]) .hd .nav a span { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1400px) { html:not([data-theme="dark"]) .hd .nav a { gap: 6px; padding: 0 6px; font-size: 13px; } html:not([data-theme="dark"]) .hd .nav { gap: 6px; } }
@media (max-width: 1180px) {               /* icons only, the name is in the tooltip and for screen readers */
  html:not([data-theme="dark"]) .hd .nav a > span:not(.bd) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  html:not([data-theme="dark"]) .hd .nav a { position: relative; height: 48px; min-height: 48px; }
}

/* schema editor: palette wide enough for its buttons, long names wrap */
html:not([data-theme="dark"]) .editor { grid-template-columns: 220px minmax(0, 1fr) 300px; gap: 20px; }
html:not([data-theme="dark"]) .palette { padding: 18px 14px; }
html:not([data-theme="dark"]) .palette button { white-space: normal; text-align: left; justify-content: flex-start; font-size: 13px; line-height: 1.2; padding: 8px 12px; min-height: 44px; }
@media (max-width: 1280px) { html:not([data-theme="dark"]) .editor { grid-template-columns: 200px minmax(0, 1fr); } html:not([data-theme="dark"]) .editor .props { grid-column: 1 / -1; } }
@media (max-width: 900px) { html:not([data-theme="dark"]) .editor { grid-template-columns: 1fr; } html:not([data-theme="dark"]) .palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; } }
html:not([data-theme="dark"]) .editor .panel, html:not([data-theme="dark"]) .editor svg { max-width: 100%; }

/* toolbars: one line, fields aligned with buttons (label to the left), one border on date fields */
html:not([data-theme="dark"]) .toolbar { align-items: center; }
html:not([data-theme="dark"]) .toolbar .field { display: flex; align-items: center; gap: 8px; }
html:not([data-theme="dark"]) .toolbar .field label { margin: 0; white-space: nowrap; }
html:not([data-theme="dark"]) input[type="date"], html:not([data-theme="dark"]) input[type="month"], html:not([data-theme="dark"]) input[type="datetime-local"] {
  border: 0; box-shadow: inset 0 0 0 1px #808080; outline-offset: 2px; }
/* full names must fit: smaller type 1321-1500 px, icons only from 1320 px (names in tooltips) */
@media (min-width: 1321px) and (max-width: 1500px) {
  html:not([data-theme="dark"]) .hd .nav a { font-size: 12px; gap: 5px; padding: 0 4px; }
  html:not([data-theme="dark"]) .hd .nav a svg.i { width: 18px; height: 18px; }
  html:not([data-theme="dark"]) .hd .nav { gap: 6px; }
}
@media (max-width: 1320px) {
  html:not([data-theme="dark"]) .hd .nav a > span:not(.bd) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  html:not([data-theme="dark"]) .hd .nav a { position: relative; height: 48px; min-height: 48px; }
}
/* site plan markers readable on dark illustrations: white label with a black frame, white ring around the dot */
html:not([data-theme="dark"]) .mk span { background: #fff; color: #000; border: 1px solid #000; border-radius: 8px; font-weight: 700; }
html:not([data-theme="dark"]) .mk i { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px #000; }

/* owner 04.11: HOREMS logo without caption. Full word, smaller from 1280 px; on a phone only the orange mark
   (the full word left the page title two letters) */
.hd .logo img { height: 40px; }
@media (max-width: 1280px) { .hd .logo .mark { height: 28px; } }
@media (max-width: 760px) {
  html:not([data-theme="dark"]) .top.hd { grid-template-columns: 32px minmax(0, 1fr) auto auto auto; }
  .hd .phmark img { width: 32px; height: 32px; }
}
.loginlogo .hor { width: min(300px, 80%); margin-bottom: 10px; }

/* conductor 04.11: phone bar in one 64 px row: mark, title + object (cut with «…»), ДЕМО, bell + alarm count, user.
   Plant time and data age are in the user menu; lost or stale data still shows as a red line under the bar. */
.hd .umenu .umstat { display: none; }
@media (max-width: 760px) {
  html:not([data-theme="dark"]) .top.hd { grid-template-rows: 64px; padding-bottom: 0; }
  html:not([data-theme="dark"]) .hd .blk.time, html:not([data-theme="dark"]) .hd #linkpill { display: none; }
  html:not([data-theme="dark"]) .hd #linkpill.bad { display: inline-flex; grid-row: 2; grid-column: 1 / -1; margin-bottom: 6px; }
  html:not([data-theme="dark"]) .hd .obj { display: flex; width: 100%; }
  html:not([data-theme="dark"]) .hd .obj #sitename { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html:not([data-theme="dark"]) .hd .obj svg.i { width: 14px; height: 14px; flex: none; }
  html:not([data-theme="dark"]) .hd .alarmcount { gap: 4px; padding: 0 9px; font-weight: 800; }
  html:not([data-theme="dark"]) .hd .alarmcount svg.i { width: 18px; height: 18px; }
  .hd .umenu .umstat { display: block; padding: 8px 10px; margin-bottom: 4px; font-size: 12px; background: var(--g); border-radius: 12px; }
}

/* owner 09.11: tablet. Card numbers follow the width of their card (bold stays), the unit drops under the number instead of being cut */
.kpiwrap .kpi { container-type: inline-size; }
html:not([data-theme="dark"]) .kpi .val { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 5px; row-gap: 2px; }
html:not([data-theme="dark"]) .kpi .val small { margin-left: 0; }
@media (min-width: 761px) {
}
@media (min-width: 761px) and (max-width: 1800px) {
  html:not([data-theme="dark"]) .kpiwrap .mkpis .kpi .val small { flex-basis: 100%; }
}
@media (max-width: 760px) {
}
/* director 09.11: page title a bit smaller and orange, the same orange as the active menu block */
.hd .ttl h1 { color: #f49415; }
@media (min-width: 761px) { .hd .ttl h1 { font-size: 34px; } }
/* tablet header: title with the object under it, status without the small print; object name wraps instead of being cut */
@media (min-width: 761px) and (max-width: 1366px) {
  html:not([data-theme="dark"]) .hd .blk.demo small, html:not([data-theme="dark"]) .hd #linktext small { display: none; }
  html:not([data-theme="dark"]) .hd .blk { padding: 0 12px; }
  .hd .ttl { flex-direction: column; align-items: flex-start; gap: 2px; }
  .hd .ttl h1 { font-size: 28px; }
  .hd .sitepick { max-width: 100%; }
  .hd .obj .k { display: none; }
  html:not([data-theme="dark"]) .hd .obj { white-space: normal; overflow: visible; text-align: left; line-height: 1.2; min-height: 24px; font-size: 13px; }
  html:not([data-theme="dark"]) .hd .obj #sitename { white-space: normal; overflow: visible; }
}
/* portrait tablet: logo and status in the first row, title and object in the second */
@media (min-width: 761px) and (max-width: 900px) {
  html:not([data-theme="dark"]) .top.hd { grid-template-columns: auto minmax(0, 1fr); }
  .hd .st { grid-column: 2; grid-row: 1; justify-self: end; }
  .hd .ttl { grid-column: 1 / -1; grid-row: 2; flex-direction: row; align-items: center; gap: 16px; margin-top: 14px; }
  .hd .ttl h1 { flex: none; }
  .hd .sitepick { flex: 1 1 0; min-width: 0; }
  html:not([data-theme="dark"]) .hd .nav { grid-column: 1 / -1; grid-row: 3; margin-top: 14px; }
}
/* the alarm badge on «Тривоги» sticks out of its icon on purpose */
html:not([data-theme="dark"]) .hd .nav a span.bd { overflow: visible; }
/* equipment tree: long names wrap */
html:not([data-theme="dark"]) .tname b, html:not([data-theme="dark"]) .tname small { white-space: normal; overflow: visible; overflow-wrap: anywhere; }

/* director 09.11: scrolling tables. Header stays put on an opaque background of its block, rows pass fully under it,
   10 px under the header text; while more rows are below, the bottom edge fades so no row looks cut in half */
.tbl { border-collapse: separate; border-spacing: 0; }
.tbl th { z-index: 3; padding-bottom: 10px; background-clip: padding-box; }
html:not([data-theme="dark"]) .tbl th { background: var(--panel); }
html:not([data-theme="dark"]) .panel .panel .tbl th, html:not([data-theme="dark"]) .modal .tbl th { background: #fff; }
.scrollmore { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 30px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 30px), transparent); }
/* arbitrage chart: colours of the HOR investment deck pie chart */
:root { --m-dis: #f19214; --m-chg: #919191; --m-idle: #fff; --m-line: #656565; }
html[data-theme="dark"] { --m-chg: #b2b2b2; --m-idle: #656565; --m-line: #fff; }
@media (min-width: 761px) and (max-width: 900px) {
  #alist th, #alist td { padding-left: 4px; padding-right: 4px; font-size: 12px; white-space: normal; }
}
.hd.nosite .sitepick { display: none; }

/* director 09.11: site plan. Controls row is not clipped; zoom buttons sit on the map, big enough for a finger */
.wrap > .toolbar { overflow: visible; }
@media (max-width: 1366px) { html:not([data-theme="dark"]) .wrap > .toolbar .sep { display: none; } }
.stage { will-change: transform; }
.stage.anim { transition: transform .2s ease-out; }
.viewport .mk { --s: calc(var(--sz) / var(--z, 1)); }
.viewport .mk::after { content: ""; position: absolute; inset: calc(-8px / var(--z, 1)); }
.mapctl { position: absolute; z-index: 6; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.mapctl button { min-width: 44px; height: 44px; padding: 0; border: 0; border-radius: 12px; background: #fff; color: #000; font: inherit; font-size: 24px; font-weight: 800; line-height: 1;
  cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .45); }
.mapctl button.txt { padding: 0 12px; font-size: 13px; }
.mapctl button:disabled { color: #919191; cursor: default; }
html:not([data-theme="dark"]) .wrap > .toolbar { overflow: visible; border-radius: 0; }
html[data-theme="dark"] .scroll { background: none; }

/* director 09.11: station photo on top of the portfolio card, same frame on every card */
.sitecard { display: flex; flex-direction: column; }
html:not([data-theme="dark"]) .sitecard { --cardpad: 30px; padding-top: 0; overflow: hidden; }
html:not([data-theme="dark"]) .sitecard.current { box-shadow: none; outline: 3px solid #f49415; outline-offset: -3px; }
.sitecard .sc-foot { margin-top: auto; padding-top: 10px; }
.sc-photo { display: flex; align-items: center; justify-content: center; gap: 8px; aspect-ratio: 16 / 9; background: #ededed; color: #4d4d4d; font-size: 13px; font-weight: 600; overflow: hidden; }
.sc-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sc-photo svg.i { width: 26px; height: 26px; }
html:not([data-theme="dark"]) .sitecard .sc-photo { margin: 0 calc(-1 * var(--cardpad)) 18px; }
@media (max-width: 760px) { html:not([data-theme="dark"]) .sitecard { --cardpad: 16px; } }
.photoedit { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 20px; align-items: start; }
.photoedit .sc-photo { border-radius: 18px; background: #fff; }
@media (max-width: 760px) { .photoedit { grid-template-columns: 1fr; } }

/* director 09.11: a marker is its icon, centred exactly on its point of the plan; the label hangs on one side and everything keeps its screen size */
.viewport .mk { --s: calc(var(--d) / var(--z, 1)); --u: calc(1px / var(--z, 1)); display: block; width: var(--s); height: var(--s); }
.viewport .mk i { display: block; }
.viewport .mk::after { inset: calc(var(--hit, 8px) / var(--z, 1) * -1); }
html:not([data-theme="dark"]) .viewport .mk i { box-shadow: 0 0 0 calc(var(--s) * .07) #fff, 0 0 0 calc(var(--s) * .125) #000; }
.viewport .mk span { position: absolute; z-index: 1; left: 100%; top: 50%; margin-left: calc(var(--u) * 5); transform: translateY(-50%); font-size: calc(var(--sz) / var(--z, 1) * .42); }
html:not([data-theme="dark"]) .viewport .mk span { padding: var(--u) calc(var(--u) * 5); border-width: var(--u); border-radius: calc(var(--u) * 6); }
.viewport .mk span.lp-l { left: auto; right: 100%; margin: 0 calc(var(--u) * 5) 0 0; }
.viewport .mk span.lp-t { left: 50%; top: auto; bottom: 100%; margin: 0 0 calc(var(--u) * 5); transform: translateX(-50%); }
.viewport .mk span.lp-b { left: 50%; top: 100%; margin: calc(var(--u) * 5) 0 0; transform: translateX(-50%); }
.viewport .mk span.lp-none { display: none; }
.viewport .mk span.short em, .viewport .mk span em:empty { display: none; }

/* owner 09.11: «розряд» badge has the same orange as the discharge bars of the arbitrage chart */
html:not([data-theme="dark"]) .tag.discharge, html:not([data-theme="dark"]) .chip.discharge, html:not([data-theme="dark"]) .kpi .chip.discharge { background: #f19214; color: #000; border: 0; }

/* owner 09.11: one scale for all figures. Every KPI number on a screen has the same size and the same orange; the unit is half of the number */
:root { --num: clamp(28px, 2.6vw, 44px); --lbl: clamp(13px, 1.05vw, 16px); --sub: clamp(12px, .9vw, 13px); --ttl: 34px; --hsec: 22px; }
@media (max-width: 1366px) { :root { --ttl: 28px; } }
@media (max-width: 760px) { :root { --num: clamp(22px, 6.4vw, 26px); --lbl: 12px; --sub: 11px; --ttl: 22px; --hsec: 17px; } }
html:not([data-theme="dark"]) .hd .ttl h1 { font-size: var(--ttl); }
html:not([data-theme="dark"]) .phead h2 { font-size: var(--hsec); }
html:not([data-theme="dark"]) .kpiwrap .kpi .val { font-size: var(--num); color: var(--or); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
html:not([data-theme="dark"]) .kpiwrap .kpi .val small { font-size: .5em; letter-spacing: 0; }
html:not([data-theme="dark"]) .kpiwrap .kpi .lbl { font-size: var(--lbl); }
html:not([data-theme="dark"]) .kpiwrap .kpi .sub { font-size: var(--sub); }
html:not([data-theme="dark"]) .big.secflow { font-size: calc(var(--num) * .7); }
/* no data: a quiet line inside the card, wraps instead of leaving it */
html:not([data-theme="dark"]) .kpi .val .n { max-width: 100%; }
html:not([data-theme="dark"]) .kpi .val .nodata { display: block; color: #000; font-size: max(13px, .42em); font-weight: 700; letter-spacing: 0; line-height: 1.2; white-space: normal; }

/* owner 09.11: live figures must not make anything around them move */
html:not([data-theme="dark"]) .kpi .val .n { display: inline-block; min-width: 4ch; }
html:not([data-theme="dark"]) .kpi .sub { min-height: calc(2em * 1.35); }
.hd .blk, #clock, .mk em, svg text.v, .bottomnav .bd em { font-variant-numeric: tabular-nums; }
.hd #linktext .age { display: inline-block; min-width: 2.4ch; text-align: right; }
#clock { display: inline-block; min-width: 5ch; text-align: right; }
@media (min-width: 761px) { html:not([data-theme="dark"]) .hd .alarmcount { min-width: 142px; justify-content: center; } }
@media (max-width: 760px) {
  html:not([data-theme="dark"]) .kpi .lbl { min-height: calc(2em * 1.2); align-content: flex-start; }
  html:not([data-theme="dark"]) .kpi .sub { min-height: calc(3em * 1.35); }
  .hd .alarmcount span { display: inline-block; min-width: 2ch; }
}

/* site plan with a mouse: nothing inside the map can be selected or dragged by the browser; arrow when there is nothing to move, hand when there is */
.viewport, .viewport * { -webkit-user-select: none; user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none; }
.viewport { cursor: default; }
.viewport.canmove { cursor: grab; }
.viewport.editing .mk { cursor: move; }
.viewport.moving, .viewport.moving * { cursor: grabbing !important; }

/* phone: the battery state sits on its own line, so its width never moves the title; the longest caption is reserved */
@media (max-width: 760px) { html:not([data-theme="dark"]) .kpi.k-bess .lbl { flex-direction: column; align-items: flex-start; gap: 2px; flex-wrap: nowrap; } }
@media (max-width: 380px) { html:not([data-theme="dark"]) .kpi .sub { min-height: calc(4em * 1.35); } }
.mk span em { min-width: 8.5ch; }
/* «немає даних» takes exactly the height of a number, so a card does not change when the figure comes back */
html:not([data-theme="dark"]) .kpi .val .nodata { line-height: var(--num); }
@media (min-width: 761px) { html:not([data-theme="dark"]) .hd .alarmcount { min-width: 150px; } }
@media (max-width: 1100px) { html:not([data-theme="dark"]) .kpi .sub { min-height: calc(3em * 1.35); } }
@media (max-width: 380px) { html:not([data-theme="dark"]) .kpi .sub { min-height: calc(4em * 1.35); } }
html:not([data-theme="dark"]) .kpi .val .n { min-width: 3.6ch; }
/* phone: a title with a badge is as tall as a two-line title, numbers of one row stand on one line */
@media (max-width: 760px) { html:not([data-theme="dark"]) .kpi .lbl { min-height: 36px; row-gap: 3px; } }

/* owner 09.11: on the overview the KPI block and the one-line diagram are not bold; section headings stay as they are */
#kpis .kpi, #kpis .kpi * { font-weight: 500; }
#sld text { font-weight: 500; }

/* owner 13.11: on the control page «Кому команда» + «Режим роботи батарей» are one full-width block;
   manual control, actions and the right column («Чому система так працює», commands, limits) sit below it */
.ctlmain { margin-bottom: 20px; }
.ctlmain .ctlmodes { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line, rgba(0,0,0,.12)); }
.ctlmain .modes { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1280px) { .ctlmain .modes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .ctlmain .modes { grid-template-columns: 1fr 1fr; } }

/* owner 13.11: mode switch is a drag slider. Green = this mode runs, red = off; drag the knob to the end to switch on. */
.mslide { --h: 38px; position: relative; display: flex; align-items: center; width: 100%; max-width: 230px; height: var(--h);
  border-radius: 999px; background: #c62828; color: #fff; user-select: none; -webkit-user-select: none; touch-action: none;
  cursor: grab; margin-top: 6px; flex: none; }
.mslide .mslide-txt { flex: 1; text-align: center; padding-left: calc(var(--h) - 4px); font-size: 12px; font-weight: 600; letter-spacing: .2px; pointer-events: none; }
.mslide .mslide-knob { position: absolute; left: 4px; top: 4px; width: calc(var(--h) - 8px); height: calc(var(--h) - 8px); border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); pointer-events: none; }
.mslide:focus-visible { outline: 3px solid #000; outline-offset: 2px; }
.mslide.is-armed { background: #1e8e3e; }
.mslide.is-on { background: #1e8e3e; cursor: default; }
.mslide.is-on .mslide-txt { padding-left: 0; padding-right: calc(var(--h) - 4px); }
.mslide.is-on .mslide-knob { left: auto; right: 4px; }
.mslide.is-dis { background: #b9b9b9; color: #fff; cursor: not-allowed; }
.mslide.is-dis .mslide-knob { box-shadow: none; }
/* the running mode: calm green frame instead of the orange fill and the black «ЗАРАЗ ДІЄ» tag */
html .modes .modecard.on, html:not([data-theme="dark"]) .modes .modecard.on { background: #fff; box-shadow: inset 0 0 0 3px #1e8e3e; }
html .modes .modecard.on span { color: #3d3d3d; }
html[data-theme="dark"] .mslide:focus-visible { outline-color: #fff; }
/* the card's own span style (grey text, flex: 1) must not reach the slider parts */
.modes .modecard .mslide span.mslide-txt { flex: 1; color: #fff; font-size: 12px; white-space: nowrap; overflow: hidden; }
.modes .modecard .mslide span.mslide-knob { flex: none; }
.mslide .mslide-off { font-style: normal; }
@media (max-width: 760px) { .mslide .mslide-off { display: none; } }
