/* Zainergy EMS, version 1 screens. Colours come from the mode (dark or light) and the chosen colour. */
:root {
  --font: 'Barlow', system-ui, sans-serif;
  --font-num: 'Barlow Semi Condensed', 'Barlow', system-ui, sans-serif;
  --alarm: #e5484d;
}
/* dark mode, per colour */
[data-mode="dark"] {
  --ink: #e9f0ff; --muted: #a9bbdb; --on-accent: #ffffff;
  --grid: rgba(255,255,255,0.10); --axis: rgba(255,255,255,0.35);
  --data: #22d26b; --max: #f59e0b; --min: #16a34a; --up: #ff5c5c; --down: #22d26b; --warn: #ffb020;
  --wire: #f2a23a; --breaker: #ff5c5c; --pa: #facc15; --pb: #4ade80; --pc: #f87171; --off: #6b7c99;
  --avatar: #ffffff;
}
[data-mode="dark"][data-accent="blue"]   { --accent: #2f7bff; --bg: #061a45; --panel: #0a2459; --edge: #21509e; --side: #0a2a6c; --bar: #082050; --tile: #0d2e6b; --field: #0f347a; }
[data-mode="dark"][data-accent="teal"]   { --accent: #14b8a6; --bg: #051c20; --panel: #08292e; --edge: #1b5a5f; --side: #073238; --bar: #062428; --tile: #0b363c; --field: #0d4047; }
[data-mode="dark"][data-accent="green"]  { --accent: #22c55e; --bg: #061b0d; --panel: #0a2914; --edge: #1f5730; --side: #0a3218; --bar: #082310; --tile: #0e351b; --field: #114021; }
[data-mode="dark"][data-accent="orange"] { --accent: #f59e0b; --bg: #1b1205; --panel: #281b08; --edge: #5a4115; --side: #30200a; --bar: #221706; --tile: #33240c; --field: #3d2b0e; --on-accent: #1b1205; }
[data-mode="dark"][data-accent="purple"] { --accent: #8b5cf6; --bg: #120c2c; --panel: #1b1340; --edge: #3d2d84; --side: #1f1650; --bar: #170f36; --tile: #241a52; --field: #2a1f5f; }
/* light mode */
[data-mode="light"] {
  --bg: #eef3f9; --panel: #ffffff; --edge: #cfdbea; --side: #ffffff; --bar: #ffffff; --tile: #f2f6fb; --field: #ffffff;
  --ink: #10233f; --muted: #4b5d78; --on-accent: #ffffff;
  --grid: #e3eaf3; --axis: #9aabc2;
  --data: #16a34a; --max: #c2410c; --min: #15803d; --up: #c81e1e; --down: #15803d; --warn: #b45309;
  --wire: #c2410c; --breaker: #b91c1c; --pa: #a16207; --pb: #15803d; --pc: #b91c1c; --off: #98a6b8;
  --avatar: #e6eef8;
}
[data-mode="light"][data-accent="blue"]   { --accent: #1d5fd1; }
[data-mode="light"][data-accent="teal"]   { --accent: #0f766e; }
[data-mode="light"][data-accent="green"]  { --accent: #15803d; }
[data-mode="light"][data-accent="orange"] { --accent: #b45309; }
[data-mode="light"][data-accent="purple"] { --accent: #6d28d9; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 14px/1.4 var(--font); }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }
.boot { padding: 40px; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* layout */
.shell { min-height: 100vh; display: flex; }
.side { width: 220px; flex: none; background: var(--side); border-right: 1px solid var(--edge); display: flex; flex-direction: column; }
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 12px; display: flex; flex-direction: column; gap: 12px; }

/* side menu */
.side-top { position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--edge); }
.side-top .who { margin-left: auto; font-weight: 600; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkish { border: 0; background: transparent; padding: 6px 4px; min-height: 32px; font-weight: 600; }
.theme-pop { margin: 10px; padding: 12px; border-radius: 8px; background: var(--panel); border: 1px solid var(--accent); display: flex; flex-direction: column; gap: 10px; }
.theme-pop .row { display: flex; gap: 6px; flex-wrap: wrap; }
.mode-btn { flex: 1 1 0; min-height: 36px; border-radius: 6px; border: 1px solid var(--edge); background: transparent; font-weight: 600; font-size: 13px; }
.mode-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.swatch { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 3px solid transparent; }
.swatch[aria-pressed="true"] { border-color: var(--ink); }
.brand { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 10px 12px; text-align: center; }
.brand .avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--avatar); display: flex; align-items: center; justify-content: center; }
.brand b { font-weight: 600; }
.brand .cust { font-size: 12px; color: var(--muted); }
.menu { display: flex; flex-direction: column; padding-bottom: 16px; }
.menu-group { display: flex; align-items: center; gap: 10px; padding: 8px 16px; font-weight: 600; }
.menu-group::before { content: ""; width: 14px; height: 14px; border-radius: 3px; background: var(--accent); flex: none; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 6px 12px 6px 34px; border: 0; background: transparent; font-size: 13px; font-weight: 500; text-align: left; text-decoration: none; color: var(--ink); }
.menu-item::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; }
.menu-item[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
.menu-item[aria-current="page"]::before { background: var(--on-accent); }
.menu-item.dev { padding-left: 44px; font-size: 12.5px; }
.menu-item.folder { padding-left: 34px; font-weight: 600; color: var(--muted); cursor: default; }
.menu-item.folder::before { display: none; }
.devlist { max-height: 46vh; overflow-y: auto; }

/* header */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px; background: var(--bar); border-bottom: 1px solid var(--edge); }
.chip { min-height: 32px; padding: 5px 12px; border-radius: 4px; border: 1px solid var(--edge); background: var(--panel); font-weight: 600; font-size: 13px; }
.chip[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.top .spacer { margin-left: auto; }
.icon-btn { border: 0; background: transparent; padding: 6px; min-height: 36px; min-width: 36px; position: relative; display: inline-flex; align-items: center; justify-content: center; color: var(--accent); }
.badge { position: absolute; top: 0; right: 0; min-width: 16px; height: 16px; border-radius: 8px; background: var(--alarm); color: #fff; font-size: 11px; font-weight: 700; text-align: center; line-height: 16px; padding: 0 3px; }
.menu-toggle { display: none; }
.signout-top { display: inline-flex; align-items: center; gap: 6px; }

/* panels */
.panel { background: var(--panel); border: 1px solid var(--edge); border-radius: 4px; padding: 10px 14px 14px; min-width: 0; }
.panel h2 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.panel h2.ruled { padding-bottom: 8px; border-bottom: 1px solid var(--edge); margin-bottom: 10px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; }
.field { min-height: 34px; padding: 4px 8px; border: 1px solid var(--accent); border-radius: 3px; background: var(--field); font-weight: 500; max-width: 100%; }
.form-grid { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px 10px; align-items: center; }
.ring { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ring div { background: var(--tile); border-radius: 3px; padding: 10px 6px 14px; text-align: center; display: flex; flex-direction: column; gap: 8px; }
.ring span:first-child { font-size: 12px; color: var(--muted); }
.ring b { font: 700 21px/1.1 var(--font-num); color: var(--data); white-space: nowrap; }
.ring b.up { color: var(--up); }
.ring b.down { color: var(--down); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.toolbar h2 { margin: 0 12px 0 0; }
.seg { min-height: 32px; padding: 4px 12px; border-radius: 3px; border: 1px solid var(--accent); background: transparent; font-weight: 600; font-size: 13px; }
.seg[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
svg.chart { width: 100%; height: auto; display: block; }
svg.chart text { font-family: var(--font); }
.empty { padding: 30px 10px; text-align: center; color: var(--muted); }

/* topology */
.diagram { overflow-x: auto; }
.dia-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.dia-head h2 { font: 600 24px/1.2 var(--font-num); margin: 0; }
.busbar { display: flex; flex-wrap: wrap; margin-top: 18px; row-gap: 14px; }
.incoming { width: 210px; flex: none; border-top: 3px solid var(--wire); padding: 10px 0 0 20px; font-size: 13px; line-height: 1.5; }
.column { flex: 1 1 250px; min-width: 250px; border-top: 3px solid var(--wire); border-left: 3px solid var(--wire); display: flex; flex-direction: column; gap: 4px; padding: 10px 0 8px; }
.column h3 { margin: 0 0 4px 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.feeder { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 2px 6px 2px 0; text-align: left; min-height: 48px; border-radius: 3px; }
.feeder:hover { background: var(--tile); }
.feeder .ph { display: flex; flex-direction: column; font-size: 13px; line-height: 1.25; min-width: 64px; }
.feeder .nm { font-size: 12.5px; display: flex; flex-direction: column; }
.feeder .nm small { color: var(--muted); }
.pa { color: var(--pa); } .pb { color: var(--pb); } .pc { color: var(--pc); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; font-size: 12px; color: var(--muted); }

/* monitor */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { background: var(--tile); border: 1px solid var(--edge); border-radius: 3px; padding: 10px 12px; display: flex; flex-direction: column; gap: 12px; }
.tile span:first-child { font-weight: 600; font-size: 13px; }
.tile span:last-child { font-size: 15px; }
.tile.alarm { border-color: var(--alarm); }
.tile.alarm span:last-child { color: var(--alarm); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.subtabs { display: flex; gap: 18px; border-bottom: 1px solid var(--edge); margin-top: 6px; }
.subtab { border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 600; padding: 8px 2px; min-height: 36px; }
.subtab[aria-pressed="true"] { color: var(--accent); border-bottom-color: var(--accent); }
table.list { width: 100%; border-collapse: collapse; min-width: 480px; }
table.list th { text-align: left; color: var(--muted); font-weight: 600; }
table.list th, table.list td { padding: 8px; border-bottom: 1px solid var(--edge); }

/* sign in */
.signin { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.signin form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; }
.signin label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.btn { min-height: 38px; padding: 6px 16px; border-radius: 4px; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); font-weight: 600; }
.error { color: var(--alarm); }

/* phones and small tablets */
@media (max-width: 820px) {
  .shell { display: block; }
  .side { width: auto; display: none; border-right: 0; border-bottom: 1px solid var(--edge); }
  .shell.menu-open .side { display: flex; }
  .menu-toggle { display: inline-flex; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .incoming { width: 100%; padding-bottom: 10px; }
  .column { min-width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* pointing at a chart */
.chart-wrap { position: relative; }
.chart-wrap svg { touch-action: pan-y; cursor: crosshair; }
.tip { position: absolute; top: 4px; z-index: 3; pointer-events: none; background: var(--panel); color: var(--ink); border: 1px solid var(--accent); border-radius: 4px; padding: 6px 10px; font-size: 13px; line-height: 1.5; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,0.25); }
.tip > b { display: block; margin-bottom: 2px; }
.sw { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.legend-row { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; margin: 4px 0; }
.graph + .graph { margin-top: 14px; }

/* reading picker with tick boxes */
.multi { position: relative; }
.multi summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-width: 220px; }
.multi summary::-webkit-details-marker { display: none; }
.multi summary::after { content: "▾"; margin-left: auto; }
.multi-list { position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; min-width: 280px; max-height: 340px; overflow-y: auto; background: var(--panel); border: 1px solid var(--accent); border-radius: 4px; padding: 4px 0; box-shadow: 0 8px 22px rgba(0,0,0,0.3); }
.multi-list label { display: flex; align-items: center; gap: 8px; padding: 6px 10px; min-height: 34px; cursor: pointer; }
.multi-list label:hover { background: var(--tile); }
.multi-list input:disabled + * , .multi-list label:has(input:disabled) { opacity: 0.55; cursor: default; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }

/* table tick box and tables */
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; cursor: pointer; min-height: 32px; }
.table-wrap { max-height: 380px; overflow: auto; border: 1px solid var(--edge); border-radius: 3px; }
table.data { min-width: 0; font-size: 13px; }
table.data th { position: sticky; top: 0; background: var(--panel); }
table.data td, table.data th { padding: 6px 10px; white-space: nowrap; }
table.data .r { text-align: right; }
@media (max-width: 820px) { .multi summary { min-width: 0; } .multi-list { min-width: 240px; } }
.leg { border: 1px solid transparent; background: transparent; padding: 3px 8px; border-radius: 3px; font-size: 13px; display: inline-flex; align-items: center; min-height: 30px; }
.leg:hover { border-color: var(--edge); }
.leg[aria-pressed="false"] { opacity: 0.45; text-decoration: line-through; }
.sync { position: relative; }
.sync-line { position: absolute; width: 0; border-left: 1.5px dashed var(--muted); pointer-events: none; z-index: 2; }
.swatches { gap: 8px; }
.swatch.small-sw { width: 26px; height: 26px; }
.swatch.pick { position: relative; overflow: hidden; display: inline-block; cursor: pointer; }
.swatch.pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.swatch.pick[aria-pressed="true"] { border-color: var(--ink); }
.swatch.pick:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.menu-type { display: block; margin: 8px 12px 2px 24px; padding: 3px 8px; border-radius: 3px; background: var(--tile); color: var(--accent); font-size: 12px; font-weight: 700; }
.busbar.pipe .column { border-top-color: var(--accent); border-left-color: var(--accent); border-top-width: 4px; }
.busbar.pipe .ph { min-width: 130px; }
#tank svg { max-width: 440px; margin: 0 auto; }
#gauge svg { max-width: 460px; margin: 0 auto; }

/* single-line diagram (tb.js) */
.dia-wrap { overflow: auto; border: 1px solid var(--edge); border-radius: 4px; background: var(--bg); max-height: 78vh; }
.dia-wrap svg { display: block; }
.dia-wrap svg text { font-family: var(--font); }
.node { cursor: pointer; }
.node:hover rect.box { stroke: var(--accent); }
.node.sel rect.box { stroke: var(--accent); stroke-width: 3; }
table.cfg { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 860px; }
table.cfg th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--edge); position: sticky; top: 0; background: var(--panel); z-index: 1; }
table.cfg td { padding: 4px 8px; border-bottom: 1px solid var(--edge); vertical-align: middle; }
table.cfg tr.sel td { background: var(--tile); }
table.cfg tr.src td:first-child { box-shadow: inset 3px 0 0 var(--wire); }
table.cfg select, table.cfg input[type=text] { min-height: 30px; padding: 2px 6px; font-size: 13px; border-color: var(--edge); }
table.cfg input[type=text] { width: 120px; }
.mv { border: 1px solid var(--edge); background: transparent; border-radius: 3px; width: 28px; height: 28px; padding: 0; line-height: 1; }
.mv:disabled { opacity: 0.3; cursor: default; }
.cfg-wrap { overflow: auto; max-height: 70vh; }
.depth { color: var(--muted); }
.legend2 { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--muted); }
.btn:disabled { opacity: 0.5; cursor: default; }

/* sign-in page background: single-line diagram with power flowing, three phases underneath */
.si-page { position: relative; overflow: hidden; isolation: isolate;
  background: radial-gradient(1200px 700px at 78% 40%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%), var(--bg); }
.si-art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.si-dot { fill: var(--ink); opacity: 0.10; }
.si-line { fill: none; stroke: var(--muted); stroke-width: 2; opacity: 0.45; }
.si-bus { stroke: var(--wire); stroke-width: 6; stroke-linecap: round; opacity: 0.55; }
.si-brk { fill: none; stroke: var(--breaker); stroke-width: 2.4; opacity: 0.55; }
.si-meter { fill: var(--panel); stroke: var(--accent); stroke-width: 1.5; opacity: 0.8; }
.si-node { fill: var(--accent); }
.si-sun { fill: none; stroke: #f5b301; stroke-width: 2; opacity: 0.75; }
.si-sun-ray { stroke: #f5b301; stroke-width: 2; stroke-linecap: round; opacity: 0.65; }
.si-flow { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 4 46; opacity: 0.9; animation: si-run 2.4s linear infinite; }
.si-flow-h { stroke: #ffd36e; stroke-dasharray: 6 60; animation-duration: 3.2s; }
.si-blink { animation: si-blink 3s ease-in-out infinite; }
.si-wave { fill: none; stroke-width: 2.5; opacity: 0.35; }
.si-a { stroke: var(--pa); } .si-b { stroke: var(--pb); } .si-c { stroke: var(--pc); }
.si-waves { animation: si-slide 9s linear infinite; }
@keyframes si-run { to { stroke-dashoffset: -100; } }
@keyframes si-blink { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@keyframes si-slide { to { transform: translateX(-360px); } }
.si-page .panel { position: relative; z-index: 1; margin-left: auto; margin-right: 8vw; padding: 26px 26px 22px;
  background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--edge)); box-shadow: 0 18px 50px rgba(0,0,0,0.35); }
.si-brand { position: absolute; top: 28px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; z-index: 1; text-align: center; }
/* the Zainergy logo as it is: its white-lettered version on dark, its navy-lettered version on light */
.si-logo { display: inline-flex; align-items: center; }
.si-logo img { display: block; height: 52px; width: auto; }
[data-mode="dark"] .si-logo .for-light, [data-mode="light"] .si-logo .for-dark { display: none; }
.si-sub { color: var(--muted); font-size: 13px; font-weight: 600; }
@media (max-width: 820px) { .si-page .panel { margin: 70px auto 0; } .si-brand { top: 16px; } }
@media (prefers-reduced-motion: reduce) { .si-flow, .si-blink, .si-waves { animation: none !important; } }

/* PV net metering */
.inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; }
.nm-kpis { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.nm-kpi { flex: 1 1 140px; min-width: 0; background: var(--tile); border-radius: 3px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.nm-kpi > span:first-child { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.nm-kpi b { font: 700 24px/1.1 var(--font-num); color: var(--data); white-space: nowrap; }
.nm-op { align-self: center; font: 700 22px/1 var(--font-num); color: var(--accent); padding: 0 2px; }
#nm-state svg { max-width: 880px; margin: 0 auto; }
.toolbar .spacer { margin-left: auto; }
.nm-node { fill: var(--tile); stroke-width: 2.5; }
.nm-ico { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.nm-sun { stroke: #f5b301; }
.nm-bolt { fill: currentColor; stroke-width: 1; }
.nm-wire { fill: none; stroke: var(--edge); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.nm-run { fill: none; stroke-width: 5; stroke-dasharray: 12 9; animation: nm-run 0.8s linear infinite; }
@keyframes nm-run { to { stroke-dashoffset: -21; } }
.nm-lbl { font-size: 15px; font-weight: 600; fill: var(--ink); }
.nm-val { font: 700 20px var(--font-num); }
.nm-share { font-size: 13px; fill: var(--muted); }
.nm-split { display: flex; height: 14px; border-radius: 3px; overflow: hidden; margin: 4px 0 6px; background: var(--tile); }
.nm-split span { display: block; min-width: 2px; }
table.data tr.total td { font-weight: 700; border-top: 2px solid var(--edge); position: sticky; bottom: 0; background: var(--panel); }
@media (max-width: 820px) { .nm-op { display: none; } .nm-kpi b { font-size: 20px; } }
@media (prefers-reduced-motion: reduce) { .nm-run { animation: none !important; stroke-dasharray: none; } }
.subtabs { overflow-x: auto; scrollbar-width: thin; }
.subtab { flex: none; white-space: nowrap; }

/* favourites, status */
.fav-row { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fav-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--edge); background: transparent; border-radius: 3px; min-height: 32px; padding: 4px 10px; font-weight: 600; font-size: 13px; color: var(--ink); }
.fav-btn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.fav-btn[aria-pressed="true"] svg { fill: #f5b301; stroke: #f5b301; }
.fav-btn.icon { border: 0; padding: 4px; min-width: 36px; justify-content: center; }
.fav-btn:disabled { opacity: 0.5; }
.fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.fav-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fav-open { font-size: 15px; text-align: left; color: var(--accent); padding-left: 0; }
.fav-vals { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; margin: 12px 0 8px; }
.fav-vals dt { color: var(--muted); }
.fav-vals dd { margin: 0; text-align: right; font: 700 16px var(--font-num); color: var(--data); }
.nm-kpi.alarm b { color: var(--alarm); }
table.data td.neg { color: var(--up); }
/* the hybrid diagram shrinks on phones, so its words and figures are drawn larger there */
@media (max-width: 600px) {
  .nm-state .nm-lbl { font-size: 17px; }
  .nm-state .nm-val { font-size: 21px; }
  .nm-figs { display: flex !important; }
}
.nm-figs { display: none; margin: 8px 0; }
.nm-figs .nm-kpi b { font-size: 20px; }
