/* 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="navy"]   { --accent: #3fd0ff; --bg: #06142b; --panel: #0a1d3a; --edge: #1a3a66; --side: #081a36; --bar: #071731; --tile: #0e2850; --field: #102c55; --on-accent: #04121f; --ink: #e6f0ff; --muted: #8fa8cc; }
[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="navy"]   { --accent: #0b6fa8; }
[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; }
/* dragging rows in the topology configurator */
.drag { display: inline-block; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; padding: 2px 6px; font-size: 18px; line-height: 1; color: var(--muted); vertical-align: middle; border-radius: 3px; }
.drag:hover { color: var(--accent); background: var(--tile); }
table.cfg tr.dragging td { opacity: 0.45; }
table.cfg tr.dragging .drag { cursor: grabbing; }
table.cfg tr.drop-before td { box-shadow: inset 0 3px 0 var(--accent); }
table.cfg tr.drop-after td { box-shadow: inset 0 -3px 0 var(--accent); }
table.cfg tr.drop-into td { background: color-mix(in srgb, var(--accent) 22%, transparent); }
/* moving boxes on the topology diagram (configurator open) */
.dia-wrap.moving .node { cursor: move; touch-action: none; }
/* topology: text sizes and readings shown */
.tsz-wrap { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-left: 10px; }
.tsz { display: inline-flex; align-items: center; gap: 4px; }
.tsz .mv { width: auto; padding: 0 6px; font-size: 12px; font-weight: 700; }
/* energy flow (Sankey) under or above the single-line diagram */
.sk-wrap { overflow-x: auto; }
.sk-wrap svg { display: block; width: 100%; min-width: 760px; height: auto; }
.sk-wrap svg text { font-family: var(--font); }
.sk-band { opacity: 0.42; transition: opacity 0.15s; }
.sk-band:hover { opacity: 0.75; }
.sk-node { cursor: ns-resize; touch-action: none; }
/* moving dots along live lines of the topology */
.dia-wrap .fl { stroke: color-mix(in srgb, var(--accent) 35%, #ffffff); stroke-width: 4.5; stroke-linecap: round; stroke-dasharray: 5 41; animation: si-run 2.2s linear infinite; pointer-events: none;
  filter: drop-shadow(0 0 2px var(--accent)) drop-shadow(0 0 5px var(--accent)); }
.dia-wrap .fl.h { stroke: #fff4cc; stroke-width: 4.5; stroke-dasharray: 7 57; animation-duration: 3s; filter: drop-shadow(0 0 2px #ffb020) drop-shadow(0 0 6px #ffb020); }
[data-mode="light"] .dia-wrap .fl { stroke: var(--accent); filter: drop-shadow(0 0 2px color-mix(in srgb, var(--accent) 60%, transparent)); }
[data-mode="light"] .dia-wrap .fl.h { stroke: #b45309; filter: drop-shadow(0 0 2px rgba(180, 83, 9, 0.5)); }
@media (prefers-reduced-motion: reduce) { .dia-wrap .fl { animation: none !important; } }

/* device information on the Trends page */
.devinfo { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 14px; margin: 0; font-size: 13px; }
.devinfo dt { color: var(--muted); font-weight: 600; }
.devinfo dd { margin: 0; overflow-wrap: anywhere; }

/* AI analysis */
.ai-form { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.ai-row { display: grid; grid-template-columns: 120px 1fr; gap: 6px 14px; align-items: start; }
.ai-row[hidden] { display: none; }
.ai-lbl { font-weight: 600; font-size: 13px; padding-top: 7px; }
.ai-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.ai-opts .seg { margin-right: -8px; }
#ai-dev { width: 100%; max-width: 420px; min-width: 0; }
.ai-row > * { min-width: 0; }
.ai-q { display: flex; flex-direction: column; gap: 4px; max-width: 640px; }
.ai-q textarea { width: 100%; resize: vertical; min-height: 56px; font: inherit; color: var(--ink); }
.ai-go { margin-top: 4px; }
.ai-wait { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.ai-spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--edge); border-top-color: var(--accent); animation: ai-spin 0.9s linear infinite; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ai-spin { animation-duration: 3s; } }
.ai-report { margin-top: 12px; }
.ai-report .toolbar h2 { font-size: 18px; }
.ai-kpis { margin-bottom: 14px; }
.ai-text { max-width: 78ch; line-height: 1.6; }
.ai-text h3 { font-size: 15px; margin: 18px 0 6px; color: var(--accent); }
.ai-text h3:first-child { margin-top: 4px; }
.ai-text p { margin: 0 0 8px; }
.ai-text ul, .ai-text ol { margin: 0 0 8px; padding-left: 22px; }
.ai-text li { margin: 3px 0; }
.ai-text li.warn { color: var(--alarm, #e5484d); }
.ai-report[lang="ur"] .ai-text { font-size: 16px; line-height: 1.9; }
@media (max-width: 640px) {
  .ai-row { grid-template-columns: 1fr; }
  .ai-lbl { padding-top: 0; }
}
@media print {
  html.ai-print, html.ai-print body { background: #fff !important; color: #000 !important; }
  html.ai-print .side, html.ai-print header.top, html.ai-print #view > section:first-child, html.ai-print .ai-report .toolbar .seg, html.ai-print #ai-copied { display: none !important; }
  html.ai-print .shell, html.ai-print .main, html.ai-print .content { display: block !important; padding: 0 !important; margin: 0 !important; overflow: visible !important; height: auto !important; }
  html.ai-print .ai-report { border: 0 !important; background: #fff !important; color: #000 !important; box-shadow: none !important; }
  html.ai-print .ai-report * { color: #000 !important; }
  html.ai-print .nm-kpi { border: 1px solid #999 !important; background: #fff !important; }
}
.ai-paid { margin-top: 12px; padding: 28px 24px; border-left: 4px solid var(--accent); }
.ai-paid h2 { font-size: 20px; margin: 0 0 8px; }
.ai-paid p { max-width: 70ch; margin: 6px 0 0; }
.ai-charts { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 4px 0 18px; }
.ai-fig.ph { max-width: 760px; }
.ai-fig { margin: 0; padding: 12px 14px 8px; border: 1px solid var(--edge); border-radius: 6px; background: var(--tile); min-width: 0; }
.ai-fig.wide { grid-column: 1 / -1; }
.ai-fig figcaption { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.ai-phases { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.ai-ph { display: grid; grid-template-columns: 22px 1fr 110px; align-items: center; gap: 10px; }
.ai-ph > .num { text-align: right; font-size: 14px; }
.ai-track { position: relative; height: 18px; border-radius: 4px; background: var(--field); overflow: hidden; }
.ai-track span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.ai-track .ai-hi { opacity: 0.35; }
@media (max-width: 900px) { .ai-charts { grid-template-columns: 1fr; } }
@media print {
  html.ai-print .ai-fig { break-inside: avoid; border: 1px solid #999 !important; background: #fff !important; }
  html.ai-print .ai-charts { grid-template-columns: 1fr; }
}
.ai-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 2px 4px 2px 10px; border: 1px solid var(--edge); border-radius: 16px; background: var(--tile); font-size: 13px; font-weight: 600; }
.ai-chip button { width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; }
.ai-chip button:hover, .ai-chip button:focus-visible { background: var(--field); color: var(--ink); }
.ai-chip .sw, .ai-cmp .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.ai-add { max-width: 280px; }
.ai-share { grid-template-columns: minmax(90px, 180px) 1fr 130px; }
.ai-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-cmp td, .ai-cmp th { white-space: nowrap; }
@media print {
  html.ai-print .ai-report, html.ai-print .ai-report * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  html.ai-print .ai-report svg text:not([fill]) { fill: #333 !important; }
  html.ai-print .ai-track { background: #e6e6e6 !important; }
}
/* topology: AI analysis menu */
.busclick { cursor: pointer; pointer-events: stroke; }
.busclick:hover { stroke: var(--accent); stroke-opacity: 0.25; }
.topo-menu { position: fixed; z-index: 50; min-width: 220px; max-width: 320px; padding: 6px; border: 1px solid var(--edge); border-radius: 8px; background: var(--panel); box-shadow: 0 8px 24px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 2px; }
.topo-menu .tm-title { font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 8px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topo-menu button { text-align: left; padding: 8px 10px; border: 0; border-radius: 5px; background: transparent; color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.topo-menu button:hover, .topo-menu button:focus-visible { background: var(--field); outline: none; }
.topo-menu button.tm-ai::before { content: "✦ "; color: var(--accent); }
.ai-btn::before { content: "✦ "; }
.ai-from { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin: 10px 0 0; border-left: 3px solid var(--accent); background: var(--tile); border-radius: 4px; font-size: 13px; }
@media print {
  html.ai-print .ai-report .table-wrap { max-height: none !important; overflow: visible !important; border: 0 !important; }
  html.ai-print .ai-report table.ai-cmp { width: 100%; font-size: 10px; }
  html.ai-print .ai-report table.ai-cmp th { background: #fff !important; color: #000 !important; border-bottom: 1.5px solid #333 !important; position: static !important; }
  html.ai-print .ai-report table.ai-cmp td, html.ai-print .ai-report table.ai-cmp th { white-space: normal; padding: 3px 5px !important; }
  html.ai-print .ai-fig { break-inside: avoid; }
}
/* Monitor: readings in groups (e.g. ME240) */
#tiles.grouped { display: flex; flex-direction: column; gap: 10px; }
.tile-group { border: 1px solid var(--edge); border-radius: 6px; padding: 6px 10px 10px; }
.tile-group > summary { cursor: pointer; padding: 4px 0 8px; font-size: 14px; list-style-position: inside; }
.tile-group > summary b { color: var(--accent); }
.tile.none { opacity: 0.55; }
/* Building (3D) */
.bd-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; }
.bd-view { position: relative; height: min(72vh, 720px); min-height: 380px; border-radius: 6px; overflow: hidden; background: radial-gradient(ellipse at 50% 30%, color-mix(in srgb, var(--panel) 70%, #2a6f78), var(--bg)); }
.bd-view canvas { display: block; touch-action: none; }
.bd-labels { position: absolute; inset: 0; pointer-events: none; }
.bd-lbl { position: absolute; transform: translate(-100%, -50%); margin-left: -8px; font-size: 12px; font-weight: 600; white-space: nowrap; padding: 2px 8px; border-radius: 11px; background: color-mix(in srgb, var(--bg) 85%, transparent); border: 1px solid var(--edge); }
.bd-lbl.pin { transform: translate(-50%, -100%); margin-left: 0; }
.bd-lbl b { color: var(--accent); }
.bd-pop { position: absolute; z-index: 5; min-width: 220px; max-width: 340px; padding: 10px 12px; border: 1px solid var(--edge); border-radius: 8px; background: var(--panel); box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.bd-pop .bd-x { position: absolute; right: 6px; top: 4px; border: 0; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
.bd-mt { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: 13px; } .bd-mt td { padding: 4px 2px; border-bottom: 1px solid var(--edge); } .bd-mt .r { text-align: right; }
.bd-side .bd-kpi { background: var(--tile); border-radius: 6px; padding: 8px 10px; margin: 10px 0; } .bd-side .bd-kpi b { display: block; font-size: 22px; color: var(--data); }
.bd-legend { display: flex; align-items: center; gap: 8px; margin: 8px 0; } .bd-legend i { flex: 1; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #1d4ed8, #14b8a6, #eab308, #ef4444); }
.bd-floors { width: 100%; border-collapse: collapse; font-size: 13px; } .bd-floors td { padding: 6px 4px; border-bottom: 1px solid var(--edge); cursor: pointer; } .bd-floors td.r { text-align: right; } .bd-floors tr.none td { opacity: .55; }
.bd-floors tr:hover td { background: var(--tile); } .bd-floors .sw, .bd-cfg .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.bd-cols { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; } .bd-cols h3 { font-size: 15px; margin: 6px 0 8px; color: var(--accent); }
.bd-tbl { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 10px; } .bd-tbl th { text-align: left; font-size: 12px; color: var(--muted); padding: 4px; } .bd-tbl td { padding: 3px 4px; border-bottom: 1px solid var(--edge); vertical-align: top; }
.bd-tbl tr.sel td { background: color-mix(in srgb, var(--accent) 18%, transparent); } .bd-tbl input.field { width: 100%; min-width: 0; } .bd-tbl input[type=number] { width: 80px; }
.bd-ms summary { cursor: pointer; padding: 6px 0; } .bd-ml { max-height: 220px; overflow: auto; display: flex; flex-direction: column; padding: 4px 0; }
@media (max-width: 1000px) { .bd-wrap, .bd-cols { grid-template-columns: 1fr; } }
/* Building tab: a control-room dashboard around the 3D model (always the navy palette, like a plant display wall) */
.bd2 { color: var(--ink); border-radius: 6px; padding: 12px; border: 1px solid var(--edge);
  background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--accent) 12%, transparent) 0%, transparent 60%), linear-gradient(color-mix(in srgb, var(--accent) 4%, transparent) 1px, transparent 1px) 0 0 / 100% 28px, var(--bg); }
.bd2 .muted { color: var(--muted); }
.bd2-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 16px; padding: 2px 4px 12px; border-bottom: 1px solid var(--edge); margin-bottom: 12px; }
.bd2-title h2 { margin: 0; font: 600 24px/1.15 var(--font-num); letter-spacing: .01em; }
.bd2-title span { font-size: 12px; color: var(--muted); }
.bd2-clock { font: 500 18px var(--font-num); color: var(--accent); white-space: nowrap; }
.bd2-tools { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.bd2-tools .seg { background: var(--tile); border-color: var(--edge); color: var(--ink); }
.bd2-grid { display: grid; grid-template-columns: 290px minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
.bd2-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.bd2-centre { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.bd2-panel { background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 88%, var(--accent)), var(--panel)); border: 1px solid var(--edge); border-radius: 4px; padding: 10px 12px 12px; }
.bd2-panel h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 0 10px; padding-left: 8px; border-left: 3px solid var(--accent); font-size: 14px; font-weight: 600; }
.bd2-panel h3 span { font-size: 11.5px; font-weight: 400; color: var(--muted); }
.bd2-empty { color: var(--muted); font-size: 13px; margin: 6px 0; }
.bd2-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bd2-kpi { background: var(--tile); border: 1px solid var(--edge); border-radius: 4px; padding: 8px 9px; display: flex; flex-direction: column; gap: 2px; }
.bd2-kpi span { font-size: 12px; color: var(--muted); }
.bd2-kpi b { font: 600 24px/1.1 var(--font-num); color: var(--accent); }
.bd2-kpi b small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.bd2-kpi em { font-style: normal; font-size: 11px; color: var(--muted); }
.bd2-svg { width: 100%; height: auto; display: block; }
.bd2-svg text { fill: var(--muted); font-size: 9px; font-family: var(--font-num); }
.bd2-svg .ax { stroke: var(--edge); }
.bd2-donut { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; align-items: center; }
.bd2-donut svg { width: 110px; height: 110px; }
.bd2-donut text { fill: var(--muted); font-size: 9px; font-family: var(--font-num); }
.bd2-donut text.big { fill: var(--ink); font-size: 17px; font-weight: 600; }
.bd2-donut ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 12px; }
.bd2-donut li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 6px; align-items: center; color: var(--muted); }
.bd2-donut li i { width: 10px; height: 10px; border-radius: 2px; }
.bd2-donut li b { color: var(--ink); font-weight: 600; }
.bd2-mini { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.bd2-mini b { color: var(--ink); margin-left: 4px; }
.bd2-hb { display: flex; flex-direction: column; gap: 6px; }
.bd2-hb .row { display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 12px; cursor: pointer; }
.bd2-hb .row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.bd2-hb .bar { height: 8px; background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 4px; overflow: hidden; }
.bd2-hb .bar i { display: block; height: 100%; background: linear-gradient(90deg, #1f7bd8, var(--accent)); border-radius: 4px; }
.bd2 .bd-floors td { border-bottom-color: var(--edge); }
.bd2 .bd-floors tr:hover td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.bd2 .bd-view { height: min(64vh, 600px); min-height: 380px; border: 1px solid var(--edge); border-radius: 4px;
  background: radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--accent) 22%, var(--panel)) 0%, var(--panel) 55%, var(--bg) 100%); }
.bd2-legend { position: absolute; left: 10px; bottom: 10px; display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); pointer-events: none; }
.bd2-legend i { width: 90px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, hsl(223,85%,50%), hsl(170,85%,50%), hsl(60,85%,50%), hsl(0,85%,50%)); }
.bd-lbl.card { transform: none; margin: 0; display: grid; grid-template-columns: 4px auto auto; grid-template-rows: auto auto; column-gap: 8px; align-items: baseline; padding: 4px 9px 5px 0; border-radius: 3px; overflow: hidden;
  background: color-mix(in srgb, var(--panel) 90%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); color: var(--ink); pointer-events: auto; cursor: pointer; font-weight: 500; }
.bd-lbl.card i { grid-row: 1 / span 2; align-self: stretch; }
.bd-lbl.card { font-size: calc(12px * var(--cs, 1)); }
.bd-lbl.card b { color: var(--ink); font-size: 1.04em; }
.bd-lbl.card em { font-style: normal; font: 600 1.08em var(--font-num); color: var(--accent); text-align: right; }
.bd-lbl.card small { grid-column: 2 / span 2; font-size: .92em; color: var(--muted); }
.bd-lbl.card.small { padding: 2px 8px 2px 0; } .bd-lbl.card.small i { grid-row: 1; }
.bd-lbl.card:hover { border-color: var(--accent); }
.bd2-bal { display: grid; grid-template-columns: 1fr; gap: 8px; }
.bd2-bal-in { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 6px; background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 88%, var(--accent)), var(--panel)); border: 1px solid var(--edge); border-radius: 4px; padding: 8px; }
.bd2-bal-in .op { align-self: center; font: 600 18px var(--font-num); color: var(--muted); }
.bd2-b { display: flex; flex-direction: column; gap: 1px; padding: 4px 6px; border-radius: 3px; border-top: 2px solid var(--accent); background: var(--tile); min-width: 0; }
.bd2-b span { font-size: 11.5px; color: var(--muted); }
.bd2-b b { font: 600 20px/1.1 var(--font-num); } .bd2-b b small { font-size: 11px; color: var(--muted); margin-left: 2px; font-weight: 500; }
.bd2-b em { font-style: normal; font-size: 11px; color: var(--muted); }
.bd2-b i { font-style: normal; font-size: 10.5px; color: var(--muted); }
.bd2-b.sup { border-top-color: #ffb547; } .bd2-b.loss { border-top-color: #ff7a90; } .bd2-b.fl { border-top-color: #2ee6a6; } .bd2-b.off { border-top-color: #8b9dff; cursor: pointer; }
.bd2-b.off:hover, .bd2-b.off:focus-visible { background: rgba(139,157,255,.12); outline: none; }
.bd2-warn { grid-column: 1 / -1; margin: 0; font-size: 12px; color: #ffb547; }
.bd2-hint { margin: 0; font-size: 12px; color: var(--muted); }
.bd2 .bd-pop { background: var(--panel); border-color: var(--edge); color: var(--ink); }
.bd2 .bd-mt td { border-bottom-color: var(--edge); } .bd2 .bd-mt tr.minus td { color: var(--muted); }
@media (max-width: 1200px) { .bd2-grid { grid-template-columns: minmax(0, 1fr) 280px; } .bd2-grid #bd-left { grid-column: 1 / -1; order: 3; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
@media (max-width: 860px) { .bd2-grid, .bd2-bal { grid-template-columns: 1fr; } .bd2-head { grid-template-columns: 1fr; } .bd2-tools { justify-content: flex-start; } .bd2 .bd-view { height: 62vh; } }
@media (max-width: 520px) { .bd2-bal-in { grid-template-columns: 1fr; } .bd2-bal-in .op { display: none; } }
.bd2 .bd-pop { max-width: min(440px, calc(100% - 16px)); }
.bd-lbl.card.left { grid-template-columns: auto auto 4px; padding: 4px 0 5px 9px; }
.bd-lbl.card.left i { grid-column: 3; grid-row: 1 / span 2; }
.bd-lbl.card.left small { grid-column: 1 / span 2; }
.bd-lbl.card.left.small { padding: 2px 0 2px 8px; } .bd-lbl.card.left.small i { grid-row: 1; }
.bd2-total { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--edge); font-size: 12.5px; color: var(--muted); }
.bd2-total b { color: var(--accent); font-size: 13px; }
.bd2 .bd-floors tr.total td { cursor: default; font-weight: 600; color: var(--accent); border-top: 2px solid var(--edge); border-bottom: 0; }
.bd2 .bd-floors tr.total:hover td { background: none; }
.bd2-chk-note { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.bd2-chk { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow: auto; }
.bd2-chk .it { padding: 6px 8px; border-left: 3px solid #ff5d6c; background: rgba(255,93,108,.07); border-radius: 2px; font-size: 13px; }
.bd2-chk .bad { color: #ff7a90; font-weight: 600; }
.bd2-kpi[data-kpi] { cursor: pointer; } .bd2-kpi[data-kpi]:hover, .bd2-kpi[data-kpi]:focus-visible { border-color: var(--accent); outline: none; }
.bd2 .bd-mt .bad { color: #ff7a90; font-size: 12px; } .bd2 .bd-mt tr.total td { border-top: 2px solid var(--edge); border-bottom: 0; color: var(--accent); }
.bd2-svg text { font-size: 8.5px; } .bd2-svg text.val { fill: var(--ink); font-size: 8px; font-weight: 600; }
.bd2-date { background: var(--tile); color: var(--ink); border: 1px solid var(--edge); border-radius: 3px; padding: 2px 4px; font: 12px var(--font); color-scheme: dark; }
[data-mode="light"] .bd2-date { color-scheme: light; }
.bd-leads { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.bd-leads polyline { fill: none; stroke: color-mix(in srgb, var(--accent) 55%, transparent); stroke-width: 1; }
.bd-leads circle { fill: var(--accent); }
.bd2-legend { left: 50%; transform: translateX(-50%); }
.bd-lbl.card { touch-action: none; user-select: none; } .bd-lbl.card.dragging { cursor: grabbing; border-color: var(--accent); z-index: 3; }
.bd2-full { position: absolute; top: 8px; right: 8px; z-index: 4; width: 30px; height: 30px; border-radius: 4px; border: 1px solid var(--edge); background: color-mix(in srgb, var(--panel) 90%, transparent); color: var(--ink); font-size: 16px; line-height: 1; cursor: pointer; }
.bd2-full:hover, .bd2-full:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }
.bd2 .bd-view.bd-full { position: fixed; inset: 0; z-index: 1000; height: 100vh; max-height: none; border-radius: 0; border: 0; }
body.bd-noscroll { overflow: hidden; }
.bd2-cs { position: absolute; top: 8px; right: 46px; z-index: 4; display: flex; align-items: center; gap: 2px; height: 30px; padding: 0 2px; border: 1px solid var(--edge); border-radius: 4px; background: color-mix(in srgb, var(--panel) 90%, transparent); }
.bd2-cs button { border: 0; background: transparent; color: var(--ink); font: 600 12px var(--font); padding: 4px 7px; cursor: pointer; border-radius: 3px; }
.bd2-cs button:hover, .bd2-cs button:focus-visible { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); outline: none; }
.bd2-cs span { font: 11px var(--font-num); color: var(--muted); min-width: 34px; text-align: center; }
.hist-rate { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.hist-rate[hidden] { display: none; }
.bd2-wx .now { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 10px; }
.bd2-wx .now i { font-style: normal; font-size: 34px; line-height: 1; }
.bd2-wx .now b { font: 600 34px/1 var(--font-num); color: var(--ink); } .bd2-wx .now b small { font-size: 14px; color: var(--muted); margin-left: 1px; }
.bd2-wx .now span { display: block; font-size: 13.5px; } .bd2-wx .now em { display: block; font-style: normal; font-size: 12px; color: var(--muted); }
.bd2-wx .meta { display: flex; justify-content: space-between; gap: 6px; margin: 10px 0; padding: 6px 0; border-top: 1px solid var(--edge); border-bottom: 1px solid var(--edge); font-size: 12px; color: var(--muted); }
.bd2-wx .days { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; text-align: center; }
.bd2-wx .days li { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 0; border-radius: 3px; background: var(--tile); }
.bd2-wx .days span { font-size: 11.5px; color: var(--muted); } .bd2-wx .days i { font-style: normal; font-size: 18px; line-height: 1.3; }
.bd2-wx .days b { font-size: 13px; } .bd2-wx .days em { font-style: normal; font-size: 11.5px; color: var(--muted); } .bd2-wx .days small { font-size: 10.5px; color: var(--accent); }
.bd2-chk-ok { margin: 8px 0 0; font-size: 12px; color: #2ee6a6; }
.bd2-chk-bad { margin-top: 8px; padding: 0; border: 0; background: none; font: 600 12px var(--font); color: #ff7a90; cursor: pointer; text-align: left; }
.bd2-chk-bad:hover, .bd2-chk-bad:focus-visible { text-decoration: underline; outline: none; }
.theme-wrap { position: relative; display: inline-flex; }
.theme-wrap .theme-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 270px; margin: 0; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.theme-top { display: inline-flex; align-items: center; gap: 6px; }
.theme-def { width: 100%; }
.bd2-co2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bd2-co2c { background: var(--tile); border: 1px solid var(--edge); border-radius: 4px; padding: 8px 9px; display: flex; flex-direction: column; gap: 2px; }
.bd2-co2c span { font-size: 12px; color: var(--muted); }
.bd2-co2c b { font: 600 22px/1.1 var(--font-num); color: var(--ink); } .bd2-co2c b small { font-size: 11px; color: var(--muted); margin-left: 3px; font-weight: 500; }
.bd2-co2c em { font-style: normal; font-size: 11px; color: var(--muted); }
.bd2-co2c i { font-style: normal; font-size: 11.5px; color: #2ee6a6; font-weight: 600; }
[data-mode="light"] .bd2-co2c i { color: #15803d; }
.bd2-co2n { margin: 8px 0 0; font-size: 12px; } .bd2-co2n b { color: #2ee6a6; } [data-mode="light"] .bd2-co2n b { color: #15803d; }
.bd2-co2f { margin: 6px 0 0; font-size: 10.5px; color: var(--muted); }
.bd2-co2c b { white-space: nowrap; }
/* text size (A− / A+ in the top bar): the pages are scaled, the top bar and menu stay as they are */
.content { zoom: var(--zoom, 1); }
.font-size { display: inline-flex; gap: 4px; }
.font-size .chip { min-width: 36px; justify-content: center; font-weight: 700; }
.font-size .chip:disabled { opacity: .45; cursor: default; }
/* real-time cards: click for a graph; arranging (administrators) */
.tile[role="button"] { cursor: pointer; } .tile[role="button"]:hover { border-color: var(--accent); }
.tile[role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tile.graphed { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tile.alarm [data-v] { color: var(--alarm); }
.tile-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.tile-bar .small.muted { flex: 1 1 260px; }
.tile-group.editing { border-style: dashed; padding-top: 8px; }
.tg-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.tg-head input { font-weight: 700; color: var(--accent); max-width: 260px; }
.tg-drop { min-height: 64px; border-radius: 4px; }
.tg-drop.over { background: color-mix(in srgb, var(--accent) 10%, transparent); outline: 1px dashed var(--accent); }
.tg-empty { grid-column: 1 / -1; align-self: center; text-align: center; padding: 18px 0; }
.tile.editing { cursor: grab; position: relative; gap: 8px; }
.tile.editing.dragging { opacity: .45; }
.tile.moved { animation: tileMoved .6s ease; }
@keyframes tileMoved { from { box-shadow: 0 0 0 2px var(--accent); } to { box-shadow: 0 0 0 0 transparent; } }
.tile-move { display: flex; gap: 2px; }
.tile-move button { flex: 1; border: 1px solid var(--edge); background: var(--panel); color: var(--ink); border-radius: 3px; font-size: 11px; padding: 2px 0; cursor: pointer; }
.tile-move button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.tile-move button:disabled { opacity: .3; cursor: default; }
#tiles.grouped { display: flex; flex-direction: column; gap: 10px; }
@media (prefers-reduced-motion: reduce) { .tile.moved { animation: none; } }
/* the side menu can be hidden on a wide screen (☰ in the menu hides it, ☰ in the top bar brings it back) */
.side-hide { min-height: 30px; min-width: 30px; padding: 3px; color: var(--ink); }
.side-hide:hover, .side-hide:focus-visible { color: var(--accent); }
@media (min-width: 821px) {
  .shell.side-closed .side { display: none; }
  .shell.side-closed .menu-toggle { display: inline-flex; }
}
/* side menu: devices only, folded by type and location */
.devlist { max-height: calc(100vh - 290px); }
.menu-type.tgl { display: flex; align-items: center; gap: 6px; width: calc(100% - 36px); border: 0; text-align: left; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; }
.tgl .caret { font-style: normal; width: 12px; flex: none; font-size: 11px; }
.tgl .cnt { margin-left: auto; font-weight: 500; font-size: 11px; color: var(--muted); }
.menu-item.folder.tgl { display: flex; align-items: center; gap: 6px; cursor: pointer; width: 100%; padding-left: 28px; }
.menu-item.folder.tgl:hover, .menu-type.tgl:hover { color: var(--accent); }
.tgl:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.fold-body[hidden] { display: none; }
.menu-item.dev.st-ok::before { background: var(--down); box-shadow: 0 0 0 2px color-mix(in srgb, var(--down) 25%, transparent); }
.menu-item.dev.st-off::before { background: var(--alarm); }
.menu-item.dev.st-none::before { background: var(--off); }
.menu-item.dev::before { width: 10px; height: 10px; }
/* favourite energy meter card */
.fc-e { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 12px; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, var(--panel)) 0%, var(--panel) 55%); }
.fc-top { display: flex; align-items: center; gap: 10px; }
.fc-ico { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); flex: none; }
.fc-today { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.fc-today b { font: 600 26px var(--font-num); color: var(--ink); }
.fc-today small { font-size: 12px; color: var(--muted); }
.fc-dot { width: 10px; height: 10px; border-radius: 50%; margin-left: auto; background: var(--off); flex: none; }
.fc-dot.ok { background: var(--down); box-shadow: 0 0 0 3px color-mix(in srgb, var(--down) 25%, transparent); } .fc-dot.off { background: var(--alarm); }
.fc-top .fav-btn.icon { margin-left: 0; }
.fc-name { font-size: 15px; font-weight: 700; text-align: left; color: var(--accent); padding: 0; margin-top: 4px; }
.fc-where { margin-top: -4px; }
.fc-phases { margin-top: 6px; border-radius: 6px; background: var(--tile); border: 1px solid var(--edge); padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; }
.fc-ph { display: grid; grid-template-columns: 30px 1fr 1fr; align-items: baseline; padding: 3px 0; }
.fc-ph + .fc-ph { border-top: 1px dashed var(--edge); }
.fc-ph > span:first-child { font-weight: 700; color: var(--muted); font-size: 12.5px; }
.fc-ph .v, .fc-ph .a { text-align: right; } .fc-ph b { font: 600 15px var(--font-num); } .fc-ph small, .fc-foot small { font-size: 11px; color: var(--muted); margin-left: 3px; }
.fc-foot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 4px; }
.fc-foot > div { display: flex; flex-direction: column; padding: 6px 8px; border-radius: 5px; background: color-mix(in srgb, var(--accent) 7%, transparent); }
.fc-foot span { font-size: 11px; color: var(--muted); } .fc-foot b { font: 600 16px var(--font-num); color: var(--ink); }
.fc-meter b { color: var(--ink); }
.fav-card[draggable="true"] { cursor: grab; } .fav-card.dragging { opacity: .45; cursor: grabbing; }
.fav-name { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; }
.fav-ren { border: 0; background: transparent; color: var(--muted); font-size: 14px; padding: 2px 4px; cursor: pointer; border-radius: 3px; }
.fav-ren:hover, .fav-ren:focus-visible { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); outline: none; }
.fav-ren-in { min-width: 0; width: 180px; }
.fav-ren-msg { flex-basis: 100%; }
.fav-name .btn, .fav-name .seg { min-height: 30px; padding: 3px 10px; }
/* Zainergy logo under Sign out, centred */
.side-logo { display: flex; justify-content: center; align-items: center; padding: 14px 24px 22px; border-top: 1px solid var(--edge); margin: 0 14px; }
.side-logo img { display: block; width: 100%; max-width: 160px; height: auto; opacity: .95; }
[data-mode="dark"] .side-logo .for-light, [data-mode="light"] .side-logo .for-dark { display: none; }
/* on a wide screen the side menu stays in view (full window height) and the logo sits centred between the line and the bottom */
@media (min-width: 821px) {
  .side { position: sticky; top: 0; height: 100vh; align-self: flex-start; overflow-y: auto; }
  .side-logo { flex: 1 1 auto; min-height: 110px; padding: 16px 24px; }
}

/* ---------- voice agent (voice.js): a panel docked at the bottom right, over the pages ---------- */
.voice-top svg { margin-right: 2px; }
.vx { position: fixed; right: 18px; bottom: 18px; z-index: 60; width: 380px; max-height: calc(100vh - 36px); display: flex; flex-direction: column;
  background: var(--panel); color: var(--ink); border: 1px solid var(--edge); border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.35); overflow: hidden; }
.vx[hidden] { display: none; }
.vx-head { display: flex; align-items: baseline; gap: 10px; padding: 12px 14px 8px; }
.vx-head b { font: 600 16px/1.2 var(--font); }
.vx-for { flex: 1; min-width: 0; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vx-x { background: none; border: 0; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px; }
.vx-x:hover { color: var(--ink); }
.vx-scope { position: relative; height: 112px; margin: 0 14px; border-radius: 10px; background: color-mix(in srgb, var(--bg) 70%, var(--panel)); border: 1px solid var(--edge); }
.vx-scope canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.vx-talk { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px; border-radius: 999px; border: 0; background: var(--accent); color: var(--on-accent); font: 600 14px/1 var(--font); cursor: pointer; }
.vx-talk[aria-pressed="true"] { background: var(--alarm); color: #fff; }
.vx-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.vx[data-state="listening"] .vx-dot { animation: vx-blink 1.2s ease-in-out infinite; }
@keyframes vx-blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .vx[data-state="listening"] .vx-dot { animation: none; } }
.vx-state { margin: 8px 14px 0; min-height: 2.6em; color: var(--muted); font-size: 13px; }
.vx[data-state="error"] .vx-state { color: var(--alarm); }
.vx-lang { display: flex; gap: 4px; margin: 6px 14px 0; padding: 3px; border-radius: 9px; background: var(--tile); }
.vx-lang button { flex: 1; border: 0; background: none; color: var(--muted); padding: 6px 4px; border-radius: 7px; font: 500 13px/1 var(--font); cursor: pointer; }
.vx-lang button[aria-checked="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 0 0 1px var(--edge); }
.vx-log { list-style: none; margin: 10px 0 0; padding: 0 14px; flex: 1; min-height: 60px; max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.vx-log:empty { display: none; }
.vx-log li { max-width: 88%; padding: 7px 10px; border-radius: 10px; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; }
.vx-log .vx-user { align-self: flex-end; background: color-mix(in srgb, var(--accent) 18%, var(--panel)); }
.vx-log .vx-agent { align-self: flex-start; background: var(--tile); }
.vx-log .vx-tool { align-self: flex-start; padding: 0 2px; color: var(--muted); font-size: 12px; }
.vx-log .vx-tool::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.vx-type { display: flex; gap: 6px; margin: 10px 14px 0; }
.vx-type input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--edge); background: var(--field); color: var(--ink); font: 400 14px var(--font); }
.vx-foot { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px 12px; color: var(--muted); font-size: 11.5px; }
.vx-foot #vx-left { font-family: var(--font-num); color: var(--ink); white-space: nowrap; }
@media (max-width: 560px) {
  .vx { left: 0; right: 0; bottom: 0; width: auto; max-height: 85vh; border-radius: 14px 14px 0 0; }
  .voice-top span { display: none; }
}
.vx [lang="ur"], .vx-log li[dir="auto"] { font-family: 'Noto Nastaliq Urdu', 'Noto Naskh Arabic', 'Jameel Noori Nastaleeq', var(--font); }
.vx-lang [lang="ur"] { font-size: 15px; }

/* ---------- voice link page (talk.html): only the voice agent, full screen on a phone ---------- */
.talk-page { min-height: 100vh; min-height: 100dvh; }
.talk-wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px 0; }
.talk-brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 10px; color: var(--muted); font-size: 13px; }
.talk-brand img { height: 26px; }
.talk-msg { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.talk-msg:empty { display: none; }
.vx.vx-full { position: static; width: auto; max-width: 560px; margin: 0 auto; max-height: none; box-shadow: none; border-radius: 14px; }
.vx.vx-full .vx-scope { height: 150px; }
.vx.vx-full .vx-log { max-height: none; min-height: 140px; }
.vx.vx-full .vx-talk { padding: 12px 26px; font-size: 16px; }
@media (max-width: 560px) { .talk-wrap { padding: 10px 10px 0; } .vx.vx-full { border-radius: 12px; } }
/* text-only agent: no microphone, no trace */
.vx[data-mode="text"] .vx-scope { display: none; }
.vx[data-mode="text"] .vx-log { min-height: 120px; }
.vx-type input:disabled { opacity: .6; }
.vx-new { margin-left: auto; background: none; border: 1px solid var(--edge); color: var(--muted); border-radius: 999px; padding: 3px 10px; font: 500 12px var(--font); cursor: pointer; white-space: nowrap; }
.vx-new:hover { color: var(--ink); border-color: var(--accent); }
.vx-head .vx-for { flex: 1; }
.vx-new:not([hidden]) + .vx-new2 { margin-left: 0; }
.vx-savebar { margin: 0 14px 8px; padding: 8px 10px; border: 1px solid var(--accent); border-radius: 10px; font: 400 13px/1.4 var(--font); color: var(--ink); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.vx-savebar[hidden] { display: none; }
.vx-savebtns { display: inline-flex; gap: 6px; align-items: center; margin-left: auto; }
.vx-savebtns .vx-x { position: static; }
/* voice link page: the building picture and floor cards above the assistant */
.talk-bld { margin: 0 0 12px; }
.talk-bld img { display: block; width: 100%; max-height: 46vh; object-fit: cover; border-radius: 12px; border: 1px solid var(--edge); background: var(--panel); }
.talk-floors { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; margin-top: 8px; }
.talk-fc { position: relative; padding: 7px 9px 9px; border-radius: 9px; background: var(--panel); border: 1px solid var(--edge); display: grid; gap: 1px; overflow: hidden; }
.talk-fc b { font: 600 12px var(--font); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.talk-fc .num { font: 600 18px var(--font-num); color: var(--ink); }
.talk-fc .num small { font-size: 11px; color: var(--muted); }
.talk-fc em { font-style: normal; font-size: 11px; color: var(--muted); }
.talk-fc i { position: absolute; left: 0; bottom: 0; height: 3px; width: var(--w); background: var(--accent); }
.talk-fc.total { border-color: var(--accent); }
.talk-when { margin: 6px 2px 0; font-size: 11.5px; color: var(--muted); }
.talk-whenrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.talk-whenrow .talk-when { margin: 0; }
.talk-refresh { flex: none; border: 1px solid var(--edge); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 5px 14px; font: 600 12.5px var(--font); cursor: pointer; }
.talk-refresh:hover { border-color: var(--accent); }
.talk-refresh:disabled { opacity: .6; cursor: default; }
button.talk-fc { text-align: left; color: inherit; font: inherit; cursor: pointer; }
button.talk-fc:hover, .talk-fc.open { border-color: var(--accent); }
.talk-fdet { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--accent); }
.talk-fdet-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.talk-fdet-h span { flex: 1; color: var(--muted); font-size: 12px; }
.talk-fdet-h button { background: none; border: 0; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.talk-fdet table { width: 100%; border-collapse: collapse; font-size: 13px; }
.talk-fdet th { text-align: left; font: 500 11.5px var(--font); color: var(--muted); padding: 4px 4px; border-bottom: 1px solid var(--edge); }
.talk-fdet td { padding: 6px 4px; border-bottom: 1px solid var(--edge); vertical-align: top; }
.talk-fdet td small { color: var(--muted); }
.talk-fdet .r { text-align: right; white-space: nowrap; }
.talk-fdet .num { font-family: var(--font-num); }
.talk-fdet tr.minus td { color: var(--muted); }
.talk-fdet tr.tot td { font-weight: 600; border-bottom: 0; }
.talk-sign { display: inline-block; font-size: 10.5px; padding: 0 6px; border-radius: 999px; border: 1px solid var(--edge); }
.talk-fdet p { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); }
/* white label: a brand with no logo shows its name */
.brand-word { font: 700 26px/1.1 var(--font-num, inherit); color: var(--accent); letter-spacing: .01em; }
.side-logo .brand-word { font-size: 20px; text-align: center; }
.si-logo img, .side-logo img { object-fit: contain; }
.si-logo img { max-width: 280px; }

/* white label, sign-in design "split": brand colour or photo panel on the left, the form on the right */
.sp-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 46fr) minmax(0, 54fr); background: var(--bg); }
.sp-panel { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 40px 48px; color: #f2f6fb;
  background-size: cover; background-position: center; overflow: hidden; }
.sp-panel::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 360px; height: 360px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.12); box-shadow: 0 0 0 60px rgba(255,255,255,.03), 0 0 0 120px rgba(255,255,255,.02); pointer-events: none; }
.sp-logo img { display: block; height: 48px; max-width: 260px; width: auto; object-fit: contain; }
.sp-logo .brand-word { color: #fff; }
.sp-copy { max-width: 460px; position: relative; z-index: 1; }
.sp-product { margin: 0 0 10px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.7); }
.sp-head { margin: 0; font: 600 clamp(28px, 3.2vw, 42px)/1.12 var(--font-num); color: #fff; }
.sp-text { margin: 14px 0 0; font-size: 16px; line-height: 1.55; color: rgba(255,255,255,.82); }
.sp-points { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sp-points li { padding: 5px 12px; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; font-size: 13px; font-weight: 500; color: #fff; }
.sp-foot { margin: 0; font-size: 13px; color: rgba(255,255,255,.7); position: relative; z-index: 1; }
.sp-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.sp-form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.sp-form h2 { margin: 0; font: 600 28px/1.2 var(--font-num); color: var(--ink); }
.sp-form .muted, .sp-form .error { margin: 0; }
.sp-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; color: var(--ink); }
.sp-form .field { min-height: 44px; padding: 8px 12px; border-radius: 6px; border: 1px solid var(--edge); font-size: 15px; color: var(--ink); }
.sp-form .field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.sp-form .btn { min-height: 46px; border-radius: 6px; font-size: 15px; margin-top: 4px; }
.sp-copy-right { margin: 18px 0 0; font-size: 12px; color: var(--muted); }
@media (max-width: 820px) {
  .sp-page { grid-template-columns: 1fr; }
  .sp-panel { padding: 24px; gap: 18px; min-height: 0; }
  .sp-points, .sp-foot, .sp-panel::after { display: none; }
  .sp-head { font-size: 26px; }
  .sp-side { padding: 28px 20px 40px; align-items: flex-start; }
}
