/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 * Copyright © 2026 Marcel Rymenhout and IniqDash contributors */
/* Climate group V1 — header + average, the shared target, shared modes / fans, then each unit (scrolls when there are many) */
.iq-cg { container: cg / size; height: 100%; box-sizing: border-box; display: grid; grid-template-rows: auto auto auto auto minmax(0, 1fr); gap: 10px; padding: 14px 16px;
  border-radius: var(--radius-device); color: var(--text-primary); font-family: var(--font); background: var(--device-surface); box-shadow: var(--device-shadow); overflow: hidden; }
.iq-cg__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.iq-cg__name { margin: 0; font-size: 14px; font-weight: var(--iq-fw-title); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iq-cg__avg { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.iq-cg__group { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.iq-cg__group[hidden], .iq-cg__modes[hidden], .iq-cg__fans[hidden] { display: none; }
.iq-cg__tgt { text-align: center; display: grid; }
.iq-cg__tgt b { font-size: clamp(26px, 10cqmin, 40px); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.iq-cg__tgt small { font-size: 11px; color: var(--text-muted); }
.iq-cg__step { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border-subtle); background: var(--surface-tertiary); color: var(--text-primary); font: 600 20px/1 var(--font); cursor: pointer; }
.iq-cg__modes, .iq-cg__fans { display: flex; flex-wrap: wrap; gap: 6px; }
.iq-cg__chip { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border-subtle); background: transparent; color: var(--text-secondary); font: 600 12px/1.2 var(--font); cursor: pointer; text-transform: capitalize; }
.iq-cg__chip[aria-pressed="true"] { background: var(--accent); color: var(--page-bg); border-color: transparent; }
.iq-cg__units { margin: 0; padding: 0; list-style: none; overflow-y: auto; min-height: 0; display: grid; align-content: start; gap: 6px; scrollbar-width: thin; }
.iq-cg__unit { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface-tertiary); border-left: 3px solid transparent; }
.iq-cg__unit[data-action="heating"] { border-left-color: var(--warning); }
.iq-cg__unit[data-action="cooling"] { border-left-color: var(--info); }
.iq-cg__unit[data-available="false"] { opacity: var(--unavailable-opacity, .5); }
.iq-cg__info { flex: 1; min-width: 0; display: grid; }
.iq-cg__info b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iq-cg__info span { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iq-cg__ctl { display: flex; align-items: center; gap: 6px; flex: none; }
.iq-cg__ctl b { min-width: 4ch; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.iq-cg__s { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border-subtle); background: transparent; color: var(--text-primary); font: 600 15px/1 var(--font); cursor: pointer; }
.iq-cg__s:disabled { opacity: .35; cursor: default; }
.iq-cg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ================================================================ DEVICE LIST (variant 'list') — heating and ventilation, one row each */
.iq-cgl { box-sizing: border-box; height: 100%; min-width: 0; display: flex; flex-direction: column; padding: 16px 14px; border-radius: 20px; color: #fff; font-family: var(--mai-font, var(--font));
  background: linear-gradient(180deg, #1f2028 0%, #1c1d24 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04); }
.iq-cgl__head { padding: 0 4px 10px; }
.iq-cgl__head h2 { margin: 0; font-size: 12px; font-weight: 600; line-height: 14px; letter-spacing: .01em; }
.iq-cgl__list { display: grid; gap: 6px; overflow-y: auto; min-height: 0; scrollbar-width: none; align-content: start; }
.iq-cgl__row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 10px 7px 7px; border-radius: 14px; background: #171a21; }
.iq-cgl__orb { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; color: #fff; background: radial-gradient(circle at 35% 30%, #ffcf86 0%, #ff8a2b 55%, #e8611c 100%); box-shadow: 0 3px 10px rgba(255, 138, 43, .4); }
.iq-cgl__orb.is-blue { background: radial-gradient(circle at 35% 30%, #8ee4ff 0%, #33b8ff 55%, #1c8ce8 100%); box-shadow: 0 3px 10px rgba(47, 192, 255, .4); }
.iq-cgl__row:not(.is-on) .iq-cgl__orb { background: #282b35; box-shadow: none; color: #8b909c; }
.iq-cgl__text { min-width: 0; display: flex; flex-direction: column; }
.iq-cgl__text b { font-size: 10.5px; font-weight: 600; line-height: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iq-cgl__text small { font-size: 8px; line-height: 11px; color: #8b909c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iq-cgl__status { display: inline-flex; font-size: 7.5px; font-weight: 600; letter-spacing: .04em; line-height: 10px; text-transform: uppercase; padding: 2px 7.5px; border-radius: 99px; background: #282b35; color: #b7bbc5; white-space: nowrap; }
.iq-cgl__status.is-on { background: rgba(255, 138, 43, .16); color: #ffb347; }
.iq-cgl__status.is-na { background: rgba(241, 60, 60, .12); color: #ff8a8a; }
.iq-cgl__sw { justify-self: end; position: relative; width: 30px; height: 17px; border: 0; padding: 0; margin: 0; border-radius: 99px; background: #15171d; cursor: pointer; box-shadow: inset 0 1.5px 4px rgba(0, 0, 0, .55); }
.iq-cgl__sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #545866; transition: transform .2s ease-in-out, background .2s; }
.iq-cgl__sw[aria-checked="true"] { background: rgba(255, 255, 255, .4); }
.iq-cgl__sw[aria-checked="true"]::after { transform: translateX(13px); background: #fff; }
.iq-cgl__sw:disabled { opacity: .5; cursor: not-allowed; }
