/* 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 */
/* Who's home — avatars with a presence ring (home green · away grey · zone blue · unknown dim), sized by the widget's own box. */
.iq-pres { container: iqpres / size; display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 14px 16px; box-sizing: border-box; border-radius: var(--radius-device, 22px);
  background: linear-gradient(165deg, var(--surface-primary-top), var(--surface-primary) 60%, var(--surface-secondary)); box-shadow: var(--device-shadow, 0 12px 26px -16px rgba(0, 0, 0, .75));
  color: var(--text-primary); font-family: var(--font, system-ui); --pres-av: clamp(36px, min(24cqh, 15cqw), 66px); }
.iq-pres__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.iq-pres__name { margin: 0; font-size: 16px; font-weight: 650; color: var(--text-heading, #fff); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iq-pres__count { margin-left: auto; flex: none; font-size: 12px; color: var(--text-secondary); }
.iq-pres__list { flex: 1; display: flex; align-items: center; justify-content: space-around; gap: 8px; margin: 0; padding: 0; list-style: none; min-height: 0; }
.iq-pres__p { flex: 1 1 0; min-width: 0; display: flex; justify-content: center; }
.iq-pres__b { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; max-width: 100%; padding: 4px; border: 0; background: none; color: inherit; font: inherit; border-radius: 14px; cursor: default; }
button.iq-pres__b { cursor: pointer; }
button.iq-pres__b:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.iq-pres__av { position: relative; flex: none; width: var(--pres-av); height: var(--pres-av); display: grid; place-items: center; border-radius: 50%; font-weight: 700; font-size: calc(var(--pres-av) * .38);
  color: var(--text-heading, #fff); background: var(--surface-tertiary, #222836); box-shadow: 0 0 0 3px var(--pres-ring), 0 0 calc(var(--pres-av) * .3) color-mix(in srgb, var(--pres-ring) 35%, transparent); --pres-ring: var(--text-muted, #7d8699); }
.iq-pres__av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.iq-pres__dot { position: absolute; right: 2%; bottom: 2%; width: 24%; height: 24%; border-radius: 50%; background: var(--pres-ring); box-shadow: 0 0 0 2px var(--surface-primary, #151b2a); }
.iq-pres__p[data-presence="home"] .iq-pres__av { --pres-ring: var(--success, #4fd69c); }
.iq-pres__p[data-presence="zone"] .iq-pres__av { --pres-ring: var(--info, #6cb8ff); }
.iq-pres__p[data-presence="away"] .iq-pres__av { --pres-ring: var(--text-muted, #7d8699); box-shadow: 0 0 0 2px var(--pres-ring); opacity: .7; }
.iq-pres__p:is([data-presence="unknown"], [data-presence="unavailable"]) .iq-pres__av { --pres-ring: var(--border-primary, rgba(255, 255, 255, .12)); box-shadow: 0 0 0 2px var(--pres-ring); opacity: .5; }
.iq-pres__tx { display: flex; flex-direction: column; align-items: center; min-width: 0; max-width: 100%; }
.iq-pres__n { font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.iq-pres__st { font-size: 11.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.iq-pres__p[data-presence="home"] .iq-pres__st { color: var(--success, #4fd69c); }
/* list: one person per row, avatar left */
.iq-pres[data-variant="list"] { --pres-av: 38px; }
.iq-pres[data-variant="list"] .iq-pres__list { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 4px; overflow: auto; }
.iq-pres[data-variant="list"] .iq-pres__p { flex: none; justify-content: stretch; }
.iq-pres[data-variant="list"] .iq-pres__b { flex-direction: row; width: 100%; gap: 12px; padding: 6px; }
.iq-pres[data-variant="list"] .iq-pres__tx { align-items: flex-start; }
@container iqpres (max-height: 110px) { .iq-pres__st { display: none; } .iq-pres { --pres-av: clamp(28px, 34cqh, 44px); } }
@container iqpres (max-width: 260px) { .iq-pres__count { display: none; } }
