/* TechMyHome's look, on top of the older sheets: the brand's colours, the frame of every page
   (a menu down the side on a desktop, a bar along the bottom on a phone), the home page with its
   modules, live video, the site plan, and the set-up screens. Loaded last. */

:root {
  --blue: #2557d6;
  --blue-dark: #1b43b0;
  --blue-tint: #e3ebfd;
  --ink: #131a2b;
  --muted: #5b6780;
  --line: #dfe5ee;
  --page: #f3f5f9;
  --card: #ffffff;
  --subtle: #f7f9fc;
  --tabs: #e9edf5;
  --link: #2557d6;
  --accent: #12b5cb;
  --gold: #ffc53d;
  --side: #0f1830;
  --side-ink: #c5cee3;
  --side-muted: #7e8aa8;
  --side-line: #1f2a48;
  --side-hover: #18233f;
  --side-on: #233c86;
  --ok: #1f8f5f;
  --ok-bg: #e3f6ec;
  --warn: #9a6a00;
  --warn-bg: #fdf1cf;
  --bad: #c0392b;
  --bad-bg: #fdecea;
  --radius: 12px;
  --shadow-1: 0 1px 2px rgb(16 24 40 / 6%), 0 1px 3px rgb(16 24 40 / 8%);
  --shadow-2: 0 6px 18px rgb(16 24 40 / 10%), 0 2px 6px rgb(16 24 40 / 6%);
  font-family: Inter, 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', sans-serif;
}
:root[data-theme='dark'] {
  --blue: #5b86f5;
  --blue-dark: #7a9dfa;
  --blue-tint: #1d2c55;
  --ink: #e8ecf5;
  --muted: #98a4bd;
  --line: #273148;
  --page: #0c111d;
  --card: #151c2c;
  --subtle: #1a2236;
  --tabs: #1d2639;
  --link: #8fb0ff;
  --side: #0a0f1c;
  --side-line: #1a2338;
  --side-hover: #141d33;
  --side-on: #213a80;
  --ok: #58c998;
  --ok-bg: #12301f;
  --warn: #e9c15c;
  --warn-bg: #362a0c;
  --bad: #ff8f85;
  --bad-bg: #3b1714;
  --shadow-1: 0 1px 2px rgb(0 0 0 / 40%);
  --shadow-2: 0 8px 22px rgb(0 0 0 / 45%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --blue: #5b86f5;
    --blue-dark: #7a9dfa;
    --blue-tint: #1d2c55;
    --ink: #e8ecf5;
    --muted: #98a4bd;
    --line: #273148;
    --page: #0c111d;
    --card: #151c2c;
    --subtle: #1a2236;
    --tabs: #1d2639;
    --link: #8fb0ff;
    --side: #0a0f1c;
    --side-line: #1a2338;
    --side-hover: #141d33;
    --side-on: #213a80;
    --ok: #58c998;
    --ok-bg: #12301f;
    --warn: #e9c15c;
    --warn-bg: #362a0c;
    --bad: #ff8f85;
    --bad-bg: #3b1714;
    --shadow-1: 0 1px 2px rgb(0 0 0 / 40%);
    --shadow-2: 0 8px 22px rgb(0 0 0 / 45%);
  }
}

body {
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
}
h1,
h2,
h3 {
  letter-spacing: -0.01em;
}
.icn {
  flex: none;
  vertical-align: -4px;
}
button {
  border-radius: 9px;
  font-weight: 500;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
button.primary {
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 1px 2px rgb(37 87 214 / 35%);
}
button.primary:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}
input,
select,
textarea {
  border-radius: 9px;
}
.table-wrap {
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
dialog {
  border-radius: 16px;
  box-shadow: var(--shadow-2);
}
.bad {
  color: var(--bad);
}
.subtabs {
  gap: 4px;
  background: var(--tabs);
  padding: 4px;
  border-radius: 11px;
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  margin-bottom: 16px;
}
.subtabs button {
  border: 0;
  background: none;
  border-radius: 8px;
  padding: 7px 14px;
  color: var(--muted);
  font-weight: 600;
  box-shadow: none;
}
.subtabs button[aria-selected='true'] {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}

/* ---- The frame ------------------------------------------------------------------------------- */

.word {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.word b,
.login-card h1 b {
  /* (the blue of the logo's points, in both themes) */
  color: #3f83f5;
  font-weight: 700;
}
body.shell {
  min-height: 100vh;
}
.side {
  display: none;
}
.main-col {
  min-width: 0;
}
body.shell .topbar {
  position: sticky;
  top: 0;
  z-index: 6;
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(10px);
}
body.shell .topbar .title strong {
  font-size: 17px;
  letter-spacing: -0.01em;
}
.icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
}
body.shell .page {
  padding: 16px 14px 150px;
  max-width: 1320px;
}
body.shell .page.narrow {
  max-width: 680px;
}

/* A phone: the pages used most along the bottom */
#tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  background: color-mix(in srgb, var(--card) 94%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
#tabbar button {
  flex: 1 1 0;
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 2px;
  border: 0;
  border-radius: 0;
  background: none;
  padding: 8px 2px 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  position: relative;
  box-shadow: none;
}
#tabbar button .l {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
#tabbar button[aria-selected='true'] {
  color: var(--blue);
}
#tabbar button[aria-selected='true'] .i {
  background: var(--blue-tint);
}
#tabbar .i {
  display: grid;
  place-items: center;
  width: 46px;
  height: 28px;
  border-radius: 14px;
  transition: background 0.15s;
}
#tabbar .n,
#nav .n {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--bad);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
#tabbar .n {
  position: absolute;
  top: 3px;
  left: calc(50% + 8px);
}
#add-button {
  bottom: calc(82px + env(safe-area-inset-bottom));
}

/* A desktop: the menu down the side, every page under its heading */
@media (min-width: 1000px) {
  body.shell:not(.signed-out) {
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr);
  }
  body.shell:not(.signed-out) .side {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    background: var(--side);
    color: var(--side-ink);
    padding: 18px 14px 14px;
    overflow-y: auto;
  }
  body.shell:not(.signed-out) #tabbar,
  body.shell:not(.signed-out) .top-logo {
    display: none;
  }
  body.shell .topbar {
    padding: 14px 28px;
  }
  body.shell .topbar .title strong {
    font-size: 20px;
  }
  body.shell .page {
    padding: 24px 28px 60px;
  }
  #add-button {
    bottom: 28px !important;
    right: 28px;
  }
}
.side .brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  text-decoration: none;
  padding: 2px 6px 4px;
}
.side .brand img {
  border-radius: 10px;
}
.side-client {
  margin: 10px 6px 14px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--side-hover);
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
}
.side-client:empty {
  display: none;
}
#nav {
  display: grid;
  gap: 2px;
}
.nav-group {
  margin: 16px 10px 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--side-muted);
}
#nav button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: 0;
  background: none;
  color: var(--side-ink);
  padding: 9px 10px;
  border-radius: 9px;
  font-weight: 500;
  font-size: 14px;
  text-align: left;
  box-shadow: none;
}
#nav button .i {
  display: grid;
  opacity: 0.85;
}
#nav button .l {
  flex: 1;
}
#nav button:hover {
  background: var(--side-hover);
  color: #fff;
}
#nav button[aria-selected='true'] {
  background: var(--side-on);
  color: #fff;
  font-weight: 600;
}
.side-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--side-line);
}
.side-foot .me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
}
.side-foot .me span:last-child {
  display: grid;
  min-width: 0;
}
.side-foot strong {
  color: #fff;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-foot small {
  color: var(--side-muted) !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--blue), var(--accent));
  color: #fff;
  font-weight: 700;
}
/* Inside the phone app: its own bar is above, so ours is slimmer */
body.in-app .topbar .title span {
  display: none;
}

/* Signing in */
.login-card {
  max-width: 380px;
  margin: 7vh auto 0;
  padding: 30px 26px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-2);
  text-align: center;
}
.login-card img {
  border-radius: 18px;
  box-shadow: 0 8px 20px rgb(37 87 214 / 30%);
}
.login-card h1 {
  margin: 14px 0 2px;
  font-size: 26px;
  letter-spacing: -0.02em;
}
.login-card label {
  text-align: left;
  margin-top: 14px;
}
.login-card button.primary {
  width: 100%;
  margin: 18px 0 10px;
  min-height: 44px;
  font-weight: 600;
}

/* ---- The home page ---------------------------------------------------------------------------- */

.homepage .hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 22px;
  border-radius: 18px;
  color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, rgb(18 181 203 / 55%) 0%, transparent 55%), linear-gradient(135deg, #1b2f7a 0%, #2557d6 70%);
  box-shadow: var(--shadow-2);
}
.homepage .hello {
  margin: 0 0 2px;
  opacity: 0.85;
  font-weight: 500;
}
.homepage .hero h2 {
  margin: 0;
  font-size: clamp(22px, 3.4vw, 30px);
  letter-spacing: -0.02em;
}
.homepage .sub {
  margin: 6px 0 0;
  opacity: 0.8;
  max-width: 46ch;
}
.homepage .attention {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: rgb(255 255 255 / 16%);
  color: #fff;
  border: 1px solid rgb(255 255 255 / 22%);
}
.pill.warn {
  background: #fff3cd;
  color: #7a5200;
  border-color: transparent;
}
.mgroup h3 {
  margin: 26px 2px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.homepage .account {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-1);
}
.homepage .account .avatar {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--blue);
  background: var(--blue-tint);
}
.homepage .account .who {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
  overflow-wrap: anywhere;
}
.mgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
}
.mcard {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: 'i t go' 'i s go';
  align-items: start;
  column-gap: 14px;
  row-gap: 8px;
  text-align: left;
  white-space: normal;
  padding: 16px 14px 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-1);
}
.mcard:hover {
  border-color: color-mix(in srgb, var(--blue) 55%, var(--line));
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}
.mcard .mi {
  grid-area: i;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: var(--blue-tint);
}
.mcard .mt {
  grid-area: t;
  display: grid;
  gap: 3px;
}
.mcard .mt strong {
  font-size: 15.5px;
}
.mcard .mt .muted {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}
.mcard .ms {
  grid-area: s;
  justify-self: start;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--tabs);
  color: var(--ink);
}
.mcard .go {
  grid-area: go;
  align-self: center;
  color: var(--muted);
}
.mcard.bad .ms {
  background: var(--bad-bg);
  color: var(--bad);
}
.mcard.bad .mi {
  background: var(--bad-bg);
  color: var(--bad);
}
.mcard.warn .ms {
  background: var(--warn-bg);
  color: var(--warn);
}
.mcard.ok .ms {
  background: var(--ok-bg);
  color: var(--ok);
}

/* ---- Live video -------------------------------------------------------------------------------- */

.community .cams {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.community .cam {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
.community .cam:fullscreen {
  background: #000;
  display: grid;
  grid-template-rows: 1fr auto;
}
.community .cam:fullscreen .livebox {
  aspect-ratio: auto;
  height: 100%;
}
.livebox {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0b0f17;
  display: grid;
  place-items: center;
}
.livebox canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.live-state {
  position: absolute;
  inset: auto 10px 10px 10px;
  margin: 0;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgb(0 0 0 / 62%);
  color: #fff;
  font-size: 12.5px;
  text-align: center;
}
.live-state.bad {
  color: #ffd0cb;
}
.camtag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgb(0 0 0 / 58%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.camtag.bodycam,
.camtag.rtmp {
  background: rgb(192 57 43 / 88%);
}
.cam .full {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: rgb(0 0 0 / 55%);
  color: #fff;
}
.sharing {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px;
  margin-bottom: 14px;
  border: 2px solid var(--bad);
  border-radius: 14px;
  background: var(--card);
}
.sharing video {
  width: 160px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 9px;
  background: #000;
}

/* ---- The site, with its buildings ---------------------------------------------------------------- */

.crumbs2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  flex-wrap: wrap;
}
.crumbs2 button {
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
}
.crumbs2 button[aria-current='true'] {
  background: var(--blue-tint);
  border-color: transparent;
  color: var(--blue);
}
.crumbs2 .sep {
  color: var(--muted);
}
.crumbs2 .here {
  font-weight: 700;
}
.plan .seg.floors {
  max-width: 100%;
  overflow-x: auto;
}
.plan .canvas.site {
  position: relative;
}
.plan svg.sitemap {
  width: 100%;
  max-height: 72vh;
  display: block;
  color: var(--muted);
}
.plan .sitemap .land {
  fill: color-mix(in srgb, #7fbf7f 22%, var(--subtle));
  stroke: var(--line);
  stroke-width: 2;
}
.plan .sitemap .bld {
  cursor: pointer;
}
.plan .sitemap .bld .shadow {
  fill: rgb(0 0 0 / 14%);
}
.plan .sitemap .bld .body {
  stroke: color-mix(in srgb, #000 28%, transparent);
  stroke-width: 1.5;
  transition: filter 0.15s;
}
.plan .sitemap .bld:hover .body,
.plan .sitemap .bld:focus-visible .body {
  filter: brightness(1.12);
}
.plan .sitemap .bld.sel .body {
  stroke: var(--blue);
  stroke-width: 4;
}
.plan .sitemap .bname {
  font-size: 21px;
  font-weight: 700;
  fill: #fff;
  paint-order: stroke;
  stroke: rgb(0 0 0 / 45%);
  stroke-width: 3px;
}
.plan .sitemap .bnote {
  font-size: 15px;
  fill: #fff;
  paint-order: stroke;
  stroke: rgb(0 0 0 / 45%);
  stroke-width: 2.5px;
}
.plan .sitemap .bld.alarm .body {
  stroke: #e5484d;
  stroke-width: 5;
  animation: bld-alarm 1s ease-in-out infinite alternate;
}
@keyframes bld-alarm {
  to {
    filter: brightness(1.35) saturate(1.4);
  }
}
.plan .sitemap .handle {
  fill: var(--blue);
  cursor: nwse-resize;
}
.plan .sitemap .draft {
  fill: color-mix(in srgb, var(--blue) 25%, transparent);
  stroke: var(--blue);
  stroke-width: 2;
  stroke-dasharray: 6 4;
}
.plan .canvas.site.tool-building svg {
  cursor: crosshair;
}
.plan .empty.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  background: color-mix(in srgb, var(--card) 80%, transparent);
  border-radius: 14px;
  padding: 20px;
}
.plan .stage.site3 {
  height: min(72vh, 620px);
}
.plan .land3 {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: color-mix(in srgb, #7fbf7f 30%, var(--subtle));
  outline: 2px solid var(--line);
  box-shadow: 0 30px 60px rgb(0 0 0 / 25%);
}
.plan .b3 {
  position: absolute;
  transform-style: preserve-3d;
  cursor: pointer;
}
.plan .b3 > i {
  position: absolute;
  backface-visibility: visible;
}
.plan .b3 .roof {
  inset: 0;
  transform: translateZ(var(--z));
  background: color-mix(in srgb, var(--bc) 82%, #fff);
  box-shadow: inset 0 0 0 2px rgb(0 0 0 / 18%);
}
.plan .b3 .wl {
  background-color: var(--bc);
  background-image: repeating-linear-gradient(to top, transparent 0, transparent calc(var(--fl) - 2px), rgb(0 0 0 / 22%) calc(var(--fl) - 2px), rgb(0 0 0 / 22%) var(--fl));
}
.plan .b3 .wl.n,
.plan .b3 .wl.s {
  left: 0;
  right: 0;
  height: var(--z);
}
.plan .b3 .wl.n {
  top: 0;
  transform-origin: top;
  transform: rotateX(90deg);
  filter: brightness(0.82);
}
.plan .b3 .wl.s {
  bottom: 0;
  transform-origin: bottom;
  transform: rotateX(-90deg);
  filter: brightness(0.94);
}
.plan .b3 .wl.e,
.plan .b3 .wl.w {
  top: 0;
  bottom: 0;
  width: var(--z);
  background-image: repeating-linear-gradient(to right, transparent 0, transparent calc(var(--fl) - 2px), rgb(0 0 0 / 22%) calc(var(--fl) - 2px), rgb(0 0 0 / 22%) var(--fl));
}
.plan .b3 .wl.w {
  left: 0;
  transform-origin: left;
  transform: rotateY(-90deg);
  filter: brightness(0.74);
}
.plan .b3 .wl.e {
  right: 0;
  transform-origin: right;
  transform: rotateY(90deg);
  filter: brightness(0.88);
}
.plan .b3 .tag {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translateZ(calc(var(--z) + 26px)) rotateZ(var(--a)) rotateX(var(--t)) translate(-50%, -50%);
  transform-origin: 0 0;
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 4px 9px;
  border-radius: 8px;
  background: rgb(15 24 48 / 82%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
}
.plan .b3 .tag small {
  font-weight: 500;
  opacity: 0.85;
}
.plan .b3 .tag small.bad {
  color: #ffb3ad;
  opacity: 1;
}
.plan .b3.alarm .roof {
  animation: bld-alarm 1s ease-in-out infinite alternate;
  box-shadow: inset 0 0 0 4px #e5484d;
}
.blist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.bcard {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  text-align: left;
  white-space: normal;
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: var(--shadow-1);
}
.bcard .big {
  grid-row: span 3;
  font-size: 26px;
  align-self: center;
}
.bcard.alarm {
  border-color: var(--bad);
}

/* ---- Set-up: points, recorders ------------------------------------------------------------------- */

.points .tiles.protocols {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.points .tile {
  display: grid;
  gap: 4px;
  text-align: left;
  white-space: normal;
  padding: 14px;
  border-radius: 12px;
}
.points .tile .n {
  font-weight: 700;
  margin-top: 4px;
}
.points .tile .add {
  color: var(--blue);
  font-weight: 600;
}
.points tr.off td {
  opacity: 0.55;
}
.points td.actions {
  white-space: nowrap;
}
dialog.points form,
dialog.videosetup form {
  display: grid;
  gap: 10px;
}
dialog.points .row,
dialog.videosetup .row {
  align-items: start;
}
.result {
  margin: 0;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--subtle);
  font-weight: 600;
}
.result.ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.result.bad {
  background: var(--bad-bg);
  color: var(--bad);
}
.videosetup .thing .what small.bad,
.videosetup .thing .what code {
  display: block;
}
.videosetup code.addr {
  margin-top: 4px;
  word-break: break-all;
  font-size: 12.5px;
}
dialog.videosetup .ch {
  display: grid;
  grid-template-columns: 64px minmax(120px, 260px) 1fr;
  gap: 8px;
  align-items: center;
  margin: 4px 0;
}
dialog.videosetup .ch label {
  margin: 0;
}

/* ---- The administrator's desktop ----------------------------------------------------------------- */

body.admin .side {
  padding-bottom: 10px;
}
body.admin .side .client-picker {
  margin: 12px 4px 4px;
  display: grid;
  gap: 4px;
}
body.admin .side .client-picker span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--side-muted);
}
body.admin .side select {
  width: 100%;
  background: var(--side-hover);
  color: #fff;
  border: 1px solid var(--side-line);
  font-weight: 600;
}
body.admin .side-foot .row-buttons {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
body.admin .side-foot .row-buttons button {
  flex: 1;
  background: var(--side-hover);
  border: 1px solid var(--side-line);
  color: var(--side-ink);
  padding: 7px 6px;
  font-size: 12.5px;
}
body.admin .side-foot .row-buttons button:hover {
  color: #fff;
}
#menu-button {
  display: none;
}
@media (max-width: 999px) {
  body.admin .side {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    width: min(290px, 86vw);
    z-index: 30;
    background: var(--side);
    color: var(--side-ink);
    padding: 18px 14px 14px;
    overflow-y: auto;
    transform: translateX(-102%);
    transition: transform 0.2s;
  }
  body.admin.menu-open .side {
    transform: none;
    box-shadow: 0 0 0 100vmax rgb(0 0 0 / 45%);
  }
  body.admin #menu-button {
    display: grid;
  }
}
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.rules-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-1);
}
.rules-card .rule {
  border: 0;
  border-radius: 0;
  background: none;
  margin: 0;
  padding: 12px 0;
}
.rules-card .rule + .rule {
  border-top: 1px solid var(--line);
}
.login .card {
  border-radius: 18px;
  box-shadow: var(--shadow-2);
  text-align: center;
}
.login .card label {
  text-align: left;
}
.login .card img {
  border-radius: 20px;
  box-shadow: 0 8px 20px rgb(37 87 214 / 30%);
}

/* ---- The plan as a list: each room with what is in it ------------------------------------------- */

.rlist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  align-items: start;
}
.rcard {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--rc, var(--line));
  border-radius: 14px;
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.rcard header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 14px 8px;
}
.rcard header strong {
  font-size: 15.5px;
}
.rcard header small {
  flex: 1;
}
.lrow {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 6px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
}
.lrow .lico {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: var(--tabs);
  transition: background 0.2s, box-shadow 0.2s;
}
.lrow.on .lico {
  background: color-mix(in srgb, var(--gold) 38%, var(--card));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 20%, transparent);
}
.lrow.alarm .lico {
  background: var(--bad-bg);
}
.lrow.offline {
  opacity: 0.6;
}
.lrow .lname {
  display: grid;
  min-width: 0;
}
.lrow .lname strong,
.lrow .lname small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lrow .reading {
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--tabs);
}
.lrow .reading.bad {
  background: var(--bad-bg);
}
.lrow .level {
  grid-column: 2 / 4;
  grid-row: 2;
  display: grid;
  grid-template-columns: auto 1fr 64px;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}
.lrow .level input {
  width: 100%;
  accent-color: var(--blue);
  padding: 0;
  border: 0;
  background: none;
}
.lrow .level output {
  text-align: right;
  font-weight: 700;
  color: var(--ink);
}
.lrow .switch {
  grid-column: 3;
  grid-row: 1;
  width: 50px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--dot);
  position: relative;
  transition: background 0.15s;
  box-shadow: none;
}
.lrow .switch i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 30%);
  transition: transform 0.15s;
}
.lrow .switch.on {
  background: var(--blue);
}
.lrow .switch.on i {
  transform: translateX(20px);
}

/* ---- SOS and Eva ---------------------------------------------------------------------------------- */

.sos-button {
  flex: none;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 0;
  background: radial-gradient(circle at 35% 30%, #ff6b5e, #c0392b 70%);
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 0 0 8px rgb(192 57 43 / 22%), 0 10px 24px rgb(192 57 43 / 45%);
}
.sos-button:active {
  transform: scale(0.96);
}
.sos-button.small {
  width: 74px;
  height: 74px;
  font-size: 20px;
  box-shadow: 0 0 0 5px rgb(255 255 255 / 22%), 0 8px 18px rgb(0 0 0 / 30%);
}
.sos-hero {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 20px 22px;
  margin-bottom: 14px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}
.sos-hero h2 {
  margin: 0 0 4px;
}
.sos-hero p {
  margin: 0;
  color: var(--muted);
}
dialog.sos-dialog {
  text-align: center;
  max-width: 340px;
  padding: 26px 24px 20px;
}
.sos-count {
  width: 96px;
  height: 96px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bad-bg);
  color: var(--bad);
  font-size: 44px;
  animation: sos-pulse 1s ease-in-out infinite;
}
.sos-count.sent {
  background: var(--ok-bg);
  color: var(--ok);
  animation: none;
}
@keyframes sos-pulse {
  50% {
    box-shadow: 0 0 0 14px rgb(192 57 43 / 14%);
  }
}
button.danger-fill {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
  font-weight: 700;
}
dialog.sos-dialog .actions {
  justify-content: center;
}
.sospage .pcard,
.musicpage .pcard {
  margin-bottom: 14px;
}
.sospage .chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--tabs);
  font-weight: 600;
}
.sospage .buttons,
.musicpage .buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sospage .voice.on {
  border-color: var(--ok);
}
.sospage progress {
  width: 100%;
}
.sospage .hline {
  padding: 6px 0;
  border-top: 1px solid var(--line);
}
.sospage .chat {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}
.sospage .chat p {
  margin: 0;
  padding: 8px 12px;
  border-radius: 12px;
  max-width: 85%;
}
.sospage .chat .me {
  justify-self: end;
  background: var(--blue);
  color: #fff;
}
.sospage .chat .eva {
  justify-self: start;
  background: var(--tabs);
}
.sospage .askrow {
  display: flex;
  gap: 8px;
}
.sospage .askrow input {
  flex: 1;
}
.sospage .icon-btn.on {
  background: var(--bad-bg);
  color: var(--bad);
}

/* ---- Music ---------------------------------------------------------------------------------------- */

.musicpage .pcard h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.musicpage .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.musicpage .station {
  display: grid;
  text-align: left;
  padding: 8px 14px;
  border-radius: 12px;
  white-space: normal;
}
.musicpage .station small {
  color: var(--muted);
  font-weight: 400;
}
.musicpage .station.on {
  border-color: var(--blue);
  background: var(--blue-tint);
}
.musicpage .station.add {
  color: var(--blue);
  border-style: dashed;
  align-content: center;
}
.mgridp {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.mplayer {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow-1);
}
.mplayer.picked {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue-tint);
}
.mplayer.offline {
  opacity: 0.6;
}
.mplayer header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mplayer .pick {
  margin: 0;
}
.mplayer .who {
  flex: 1;
  display: grid;
  min-width: 0;
}
.mplayer .now {
  margin: 10px 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mplayer .ctl {
  display: grid;
  grid-template-columns: auto auto 1fr 30px;
  align-items: center;
  gap: 10px;
}
.mplayer .ctl input {
  width: 100%;
  accent-color: var(--blue);
  padding: 0;
  border: 0;
  background: none;
}
.mplayer .ctl output {
  text-align: right;
  font-weight: 700;
  font-size: 13px;
}
.mplayer .round {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  padding: 0;
  font-size: 16px;
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.mplayer .round.on {
  background: var(--card);
  color: var(--blue);
}
.mplayer .mini {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
}
.mplayer .eq {
  display: none;
  align-items: end;
  gap: 2px;
  height: 18px;
}
.mplayer.playing .eq {
  display: flex;
}
.mplayer .eq i {
  width: 3px;
  background: var(--blue);
  border-radius: 2px;
  animation: eq 0.9s ease-in-out infinite;
}
.mplayer .eq i:nth-child(2) {
  animation-delay: 0.25s;
}
.mplayer .eq i:nth-child(3) {
  animation-delay: 0.5s;
}
@keyframes eq {
  0%,
  100% {
    height: 4px;
  }
  50% {
    height: 18px;
  }
}
.howgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}
.howgrid h4 {
  margin: 0 0 6px;
}
.howgrid pre {
  white-space: pre-wrap;
  word-break: break-all;
}

/* ---- Alerts: the bell, its list, the page ---------------------------------------------------------- */

.icon-btn.bell {
  position: relative;
}
.icon-btn.bell .n {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--bad);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
}
.icon-btn.bell.ringing {
  color: var(--bad);
  border-color: var(--bad);
  animation: bell-ring 1s ease-in-out infinite;
}
@keyframes bell-ring {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-14deg); }
  40% { transform: rotate(12deg); }
  60% { transform: rotate(-8deg); }
  80% { transform: rotate(6deg); }
}
.bell-panel {
  position: fixed;
  top: 62px;
  right: 12px;
  z-index: 40;
  width: min(440px, calc(100vw - 24px));
  max-height: min(70vh, 560px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
.bell-panel header,
.bell-panel footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.bell-panel footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}
.bell-panel .list {
  overflow-y: auto;
  padding: 4px 12px;
}
.arow {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.arow:last-child {
  border-bottom: 0;
}
.arow .adot,
.kdot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ac, var(--muted));
}
.kdot {
  margin-right: 8px;
  vertical-align: -1px;
}
.arow.critical .adot {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ac) 28%, transparent);
  animation: sos-pulse 1s ease-in-out infinite;
}
.arow .what {
  display: grid;
  min-width: 0;
}
.arow .what small {
  white-space: normal;
}
.alertspage .acard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px 16px;
  box-shadow: var(--shadow-1);
}
.alertspage .pcard {
  margin-bottom: 14px;
}
.alertspage .bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.alertspage h4 {
  margin: 16px 0 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.alertspage .krow {
  display: grid;
  grid-template-columns: 20px minmax(140px, 1fr) auto minmax(150px, 220px) auto;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}
.alertspage .krow label {
  margin: 0;
}
@media (max-width: 640px) {
  .alertspage .krow {
    grid-template-columns: 20px 1fr auto;
  }
  .alertspage .krow select {
    grid-column: 2 / 4;
  }
  .arow {
    grid-template-columns: 12px minmax(0, 1fr) auto;
  }
  .arow .link {
    display: none;
  }
}

/* ---- Music: online services, the library, this device ------------------------------------------- */

.musicpage .linkrow {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(160px, 2fr) auto;
  gap: 8px;
  margin-top: 10px;
}
.musicpage .askrow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.musicpage .askrow input {
  flex: 1;
  min-width: 160px;
}
.musicpage .sptiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin: 10px 0;
}
.musicpage .sptile {
  display: grid;
  gap: 4px;
  text-align: left;
  white-space: normal;
  padding: 8px;
  border-radius: 12px;
}
.musicpage .sptile img,
.musicpage .sptile .noimg {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: var(--tabs);
  display: grid;
  place-items: center;
  font-size: 30px;
}
.musicpage .sptile strong {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.musicpage label.inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.musicpage .bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.musicpage .filepick {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  cursor: pointer;
  font-weight: 500;
  margin: 0;
}
.musicpage .localnow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}
.musicpage .localnow .round {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  padding: 0;
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.musicpage .thing.on strong {
  color: var(--blue);
}

/* ---- A desktop is a console: the menu and the top bar stay, only what is under the bar scrolls ------- */

@media (min-width: 1000px) {
  body.shell:not(.signed-out) {
    height: 100vh;
    overflow: hidden;
  }
  body.shell:not(.signed-out) .main-col {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 0;
  }
  body.shell:not(.signed-out) .main-col .topbar {
    flex: none;
    position: static;
  }
  body.shell:not(.signed-out) .main-col .page {
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: none;
    overflow-y: auto;
    scrollbar-gutter: stable;
    padding: 20px 28px 28px;
  }
  body.shell:not(.signed-out) .main-col .page.narrow > * {
    max-width: 760px;
  }

  /* Open alarms: four show, the rest scroll inside the block, so what is under them stays in place */
  .smart .alarms .alarm-list {
    max-height: 236px;
    overflow-y: auto;
  }

  /* Home: each group a column, each module one compact row: its name, and the number that matters now
     (what it is, where there is no number; the whole of it on hovering). Who is signed in and Sign out
     are in the menu and the top bar here. */
  .homepage .hero {
    align-items: center;
    padding: 16px 22px;
  }
  .homepage .hero .sub,
  .homepage .mgroup.account-group {
    display: none;
  }
  .homepage .groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    column-gap: 18px;
    align-items: start;
  }
  .homepage .mgroup h3 {
    margin: 18px 2px 8px;
  }
  .homepage .mgrid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .homepage .mcard {
    padding: 10px 8px 10px 11px;
    column-gap: 11px;
    row-gap: 3px;
    align-items: center;
  }
  .homepage .mcard .mi {
    width: 38px;
    height: 38px;
  }
  .homepage .mcard .mt strong {
    font-size: 14.5px;
  }
  .homepage .mcard .mt .muted {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    overflow: hidden;
  }
  .homepage .mcard:has(.ms) .mt .muted {
    display: none;
  }

  /* SOS & voice: its cards in two columns, the button across both */
  .sospage {
    columns: 2;
    column-gap: 16px;
  }
  .sospage > * {
    break-inside: avoid;
  }
  .sospage > .sos-hero {
    column-span: all;
  }

  /* Cameras: more of them in a row */
  .community .cams {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}
@media (min-width: 1700px) {
  .sospage {
    columns: 3;
  }
}
/* (a tall screen has room for what each module is, under its number) */
@media (min-width: 1000px) and (min-height: 900px) {
  .homepage .mcard:has(.ms) .mt .muted {
    display: -webkit-box;
  }
}
@media (min-width: 1000px) {
  /* (a phone leaves room under the page for its bar of tabs; a desktop has none) */
  body.shell:not(.signed-out) .main-col .page {
    padding-bottom: 28px !important;
  }
  /* A floor's or the site's drawing fits what is left of the screen, so its devices list stays in sight */
  .plan svg.flat,
  .plan svg.sitemap {
    max-height: max(300px, calc(100vh - 330px));
  }
  .sos-hero {
    padding: 12px 18px;
  }
  .sos-hero .sos-button {
    width: 78px;
    height: 78px;
    font-size: 22px;
  }
}
@media (min-width: 1300px) {
  .sospage {
    columns: 3;
  }
}
@media (min-width: 1000px) {
  /* The devices: a panel that scrolls by itself, its areas side by side, so the alarms, the numbers
     and the search above it stay where they are */
  .smart .devlist {
    max-height: max(300px, calc(100vh - 400px));
    overflow-y: auto;
    padding-right: 6px;
  }
  .smart .devcols {
    columns: 3 300px;
    column-gap: 22px;
  }
  .smart .devcols .dev {
    break-inside: avoid;
  }
  .smart .devgroup h3 {
    break-after: avoid;
  }
  .smart .devgroup h3:first-child {
    margin-top: 6px;
  }
}

/* ---- Cameras: who watches each, and a home's own set-up ---------------------------------------------- */

.community .cam .watchers {
  display: block;
  margin-top: 2px;
}
dialog.community .pick {
  display: grid;
  gap: 2px;
  max-height: 240px;
  overflow-y: auto;
  margin-top: 6px;
}
dialog.community fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px 10px;
  margin: 0 0 12px;
  display: grid;
  gap: 4px;
}
dialog.community fieldset legend {
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
dialog.setup-dialog {
  width: min(880px, 96vw);
  max-height: 92vh;
}
dialog.setup-dialog .dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
dialog.setup-dialog .dialog-head h2 {
  margin: 0;
}

/* ---- Pages & layout: the pages of a role or a person, arranged ---------------------------------------- */

.layoutpage .pcard,
.statuspage .pcard {
  margin-bottom: 14px;
}
.layoutpage .row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
}
.layoutpage .seg {
  display: inline-flex;
  gap: 4px;
  margin-top: 4px;
}
.layoutpage .seg button[aria-pressed='true'] {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.layoutpage .lrows {
  display: grid;
  gap: 6px;
  margin: 10px 0 14px;
}
.layoutpage .lrow {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) minmax(120px, 220px) auto;
  align-items: center;
  gap: 12px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}
.layoutpage .lrow.off .pname,
.layoutpage .lrow.off input[data-in='label'] {
  opacity: 0.5;
}
.layoutpage .lrow .moves {
  display: inline-flex;
  gap: 4px;
}
.layoutpage .lrow .moves button {
  padding: 4px 9px;
  min-height: 0;
  font-size: 11px;
}
.layoutpage .lrow .pname {
  display: grid;
  min-width: 0;
}
.layoutpage .actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}
@media (max-width: 620px) {
  .layoutpage .lrow {
    grid-template-columns: auto 1fr auto;
  }
  .layoutpage .lrow input[data-in='label'] {
    grid-column: 1 / -1;
  }
}

/* ---- Server status ------------------------------------------------------------------------------------ */

.statuspage .bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.statuspage .bar .spacer {
  flex: 1;
}
.statuspage .pill.ok {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: transparent;
}
.statuspage .tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.statuspage .tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.statuspage .tile strong {
  font-size: 24px;
  letter-spacing: -0.02em;
}
.statuspage .tile.bad strong {
  color: var(--bad);
}
.statuspage .cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
  align-items: start;
}
.statuspage .meter {
  margin-bottom: 10px;
}
.statuspage .meter .mhead {
  display: flex;
  justify-content: space-between;
}
.statuspage .meter .track {
  height: 8px;
  border-radius: 4px;
  background: var(--tabs);
  overflow: hidden;
  margin: 4px 0;
}
.statuspage .meter .track i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--blue);
}
.statuspage .meter.warn .track i {
  background: #d99a00;
}
.statuspage .meter.bad .track i {
  background: var(--bad);
}
.statuspage .spark {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 70px;
  margin-bottom: 8px;
}
.statuspage .spark i {
  flex: 1;
  border-radius: 3px 3px 0 0;
  background: var(--blue);
}
.statuspage .spark i.bad {
  background: var(--bad);
}
.statuspage .thing {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
}
.statuspage .thing .what {
  flex: 1;
  display: grid;
  min-width: 0;
  overflow-wrap: anywhere;
}
.statuspage .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.statuspage .chip {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--tabs);
  font-size: 12.5px;
}

/* ---- A video call from a browser (call.js) -------------------------------------------------------------- */

dialog.call-dialog {
  width: min(900px, 96vw);
  max-height: 94vh;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
}
/* (the picture takes what the buttons leave: they stay in sight whatever its shape) */
dialog.call-dialog[open] {
  display: flex;
  flex-direction: column;
}
.call-dialog .call-video {
  position: relative;
  background: #05070d;
  flex: 1 1 auto;
  min-height: 0;
  height: min(62vh, 520px);
  width: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.call-dialog .call-bar {
  flex: none;
}
.call-dialog video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
}
.call-dialog .call-video.live video {
  opacity: 1;
}
.call-dialog .call-wait {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  color: #dfe6f5;
  text-align: center;
  padding: 20px;
}
.call-dialog .call-wait .big {
  font-size: 52px;
}
.call-dialog .call-video.live .call-wait {
  display: none;
}
.call-dialog .call-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}
.call-dialog .call-bar .spacer {
  flex: 1;
}

/* ---- Where an alarm is, on the plan: its room, its floor and its building flash in the alarm's own colour
   (--ac) until it is acknowledged, then stay tinted until it is closed. The flash is the digital twin's
   floor plan's (alert-flash). ------------------------------------------------------------------------- */

@keyframes alert-flash {
  0% {
    fill-opacity: 0.55;
    stroke-opacity: 1;
  }
  50% {
    fill-opacity: 0;
    stroke-opacity: 0;
  }
}
/* (a box is washed over with the alarm's colour and let go again: what is under it stays as it is) */
@keyframes alert-flash-box {
  0% {
    box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--ac) 62%, transparent), 0 0 26px 6px color-mix(in srgb, var(--ac) 70%, transparent);
  }
  50% {
    box-shadow: inset 0 0 0 999px transparent, 0 0 0 0 transparent;
  }
}
/* 2D: over the room (or the whole floor, where the alarm has no room) */
.plan svg .aflash {
  fill: var(--ac, #e5484d);
  fill-opacity: 0.22;
  stroke: var(--ac, #e5484d);
  stroke-width: 5;
  pointer-events: none;
}
.plan svg .aflash.wide {
  fill-opacity: 0.12;
  stroke-width: 7;
}
.plan svg .aflash.flash {
  animation: alert-flash 1s ease-in-out infinite;
}
/* 3D: the room's tile, and the floor */
.plan .r3.alarmed {
  background-color: color-mix(in srgb, var(--ac) 30%, var(--rc, transparent));
  box-shadow: inset 0 0 0 4px var(--ac);
}
.plan .f3.alarmed {
  box-shadow: 0 0 0 5px var(--ac);
}
.plan .r3.alarmed.flash,
.plan .f3.alarmed.flash {
  animation: alert-flash-box 1s ease-in-out infinite;
}
/* the floors to pick from */
.plan .seg.floors button.alarmed {
  border-color: var(--ac);
  color: var(--ac);
  font-weight: 700;
}
.plan .seg.floors button.alarmed.flash {
  animation: alert-flash-box 1s ease-in-out infinite;
}
/* the site: a building in the alarm's colour */
.plan .sitemap .bld.alarmed .body {
  stroke: var(--ac);
  stroke-width: 6;
}
.plan .sitemap .bld.alarmed.flash .body {
  animation: alert-flash 1s ease-in-out infinite;
  fill-opacity: 1;
}
.plan .b3.alarmed .roof {
  box-shadow: inset 0 0 0 5px var(--ac);
}
.plan .b3.alarmed.flash .roof,
.plan .b3.alarmed.flash .wl {
  animation: alert-flash-box 1s ease-in-out infinite;
}
.plan .bcard.alarmed {
  border-color: var(--ac);
}
.plan .bcard.alarmed.flash {
  animation: alert-flash-box 1s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .plan .flash,
  .plan .flash * {
    animation: none !important;
  }
}

/* Home: what needs someone now is a button that opens its page */
.homepage button.pill {
  cursor: pointer;
  min-height: 0;
  box-shadow: none;
  font-family: inherit;
}
.homepage button.pill:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

/* ---- The door bell log: who rang, with a picture ------------------------------------------------------ */

.doorlog .bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.doorlog .bar .spacer {
  flex: 1;
}
.doorlog .seg {
  display: inline-flex;
  gap: 4px;
}
.doorlog .seg button[aria-pressed='true'] {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.doorlog .rings h3 {
  margin: 18px 2px 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.doorlog .rings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 0 14px;
}
.doorlog .rings h3 {
  grid-column: 1 / -1;
}
.doorlog .ring {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.doorlog .ring .what {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.doorlog .shot {
  flex: none;
  width: 104px;
  height: 78px;
  padding: 0;
  min-height: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 0;
  background: var(--tabs);
  display: grid;
  place-items: center;
  font-size: 26px;
}
.doorlog .shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.doorlog .shot.none img {
  display: none;
}
.google-signin {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-top: 4px;
}
.google-signin[hidden] {
  display: none;
}
.google-signin .or {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.call-shot {
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  display: block;
}
.call-shot img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
dialog.doorlog-shot {
  padding: 10px;
  max-width: min(96vw, 900px);
  text-align: center;
}
dialog.doorlog-shot img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 8px;
}
dialog.doorlog-shot p {
  margin: 8px 0 0;
}
