@font-face {
  font-family: Outfit;
  src: url("assets/outfit-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --blue: #134d8d;
  --deep-blue: #103e73;
  --red: #e3161b;
  --red-hover: #ad1215;
  --ink: #202020;
  --muted: #626a73;
  --page: #f5f7f9;
  --border: #dce2e8;
  --pale-blue: #edf4fc;
  --gutter: 24px;
  font-family: Outfit, Arial, sans-serif;
  color: var(--ink);
  background: var(--page);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
h1, h2, p { margin: 0; }
button { font: inherit; }
button:not(:disabled) { cursor: pointer; }

:focus-visible {
  outline: 3px solid #1265be;
  outline-offset: 3px;
}

.symbol-library { position: absolute; width: 0; height: 0; }
.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wrap {
  width: min(1080px, calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  min-height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.wordmark { display: block; width: 216px; min-width: 0; max-width: 53%; height: auto; }
.topbar-inner > .live-actions { flex-shrink: 0; }
.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #efdcb5;
  border-radius: 100px;
  padding: 6px 11px;
  color: #6b4206;
  background: #fff6e3;
  font-size: 13px;
  font-weight: 600;
}

.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #a76608; }
main { padding-block: 24px 16px; }

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 184px;
  border-radius: 20px;
  padding: 28px clamp(22px, 4vw, 40px);
  background: linear-gradient(112deg, #0e345f, var(--blue) 72%, #205f9f);
  color: #fff;
}

.hero-art {
  position: absolute;
  z-index: -1;
  right: 0;
  bottom: -10px;
  width: 370px;
  max-width: 55%;
  color: #b4d8ff;
  opacity: .56;
  pointer-events: none;
}

.hero-copy { min-width: 0; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #dcecff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.eyebrow::before { content: ""; width: 20px; height: 2px; background: #ff6268; }
.hero h1 {
  margin-top: 5px;
  font-size: clamp(33px, 5vw, 52px);
  line-height: 1.06;
  letter-spacing: -.035em;
  font-weight: 650;
}

.hero-description { margin-top: 8px; color: #e3efff; font-size: 16px; }
.module-nav { display: none; }
.module-nav.has-cameras { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.module-nav.has-cameras a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--deep-blue);
  background: #fff;
  font-weight: 600;
  text-decoration: none;
}
.module-nav.has-cameras a:hover { background: var(--pale-blue); }
#camera-view-open { background: var(--blue); color: #fff; }
#camera-view-open:hover { background: var(--deep-blue); }
#telecamere { grid-column: 1 / -1; }
.camera-view-actions { display: none; }
.camera-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-block: 14px; }
.camera-field { display: grid; gap: 4px; min-width: 0; }
.camera-field label { color: var(--muted); font-size: 14px; }
.camera-tools select, .camera-group-dialog select {
  min-height: 44px;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--deep-blue);
  background: #fff;
  font: inherit;
}
.camera-groups { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.camera-group-field { flex: 1 1 210px; }
.camera-group-field select { width: 100%; }
.camera-group-dialog {
  width: min(490px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--ink);
  background: #fff;
}
.camera-group-dialog::backdrop { background: #071c36a8; }
.camera-group-dialog form { display: grid; gap: 12px; }
.camera-group-dialog h3 { margin: 0; color: var(--deep-blue); font-size: 22px; }
.camera-group-dialog input[type="text"] {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: inherit;
  font: inherit;
  font-size: 16px;
}
.camera-group-channels { min-width: 0; margin: 0; padding: 0; border: 0; }
.camera-group-channels legend { margin-bottom: 4px; }
.camera-group-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  max-height: min(38dvh, 320px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--border);
  border-radius: 9px;
}
.camera-group-options label { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 5px 8px; cursor: pointer; }
.camera-group-options label:nth-child(4n+3), .camera-group-options label:nth-child(4n+4) { background: var(--page); }
.camera-group-options span { min-width: 0; overflow-wrap: anywhere; }
.camera-group-options input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--deep-blue); }
.camera-group-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.camera-group-actions .button { min-height: 44px; }
.camera-group-actions .button-danger { color: #a91e2a; border-color: #e8bec2; background: #fff; }
.camera-delete-confirm { padding: 9px; border: 1px solid #e8bec2; border-radius: 9px; }
.camera-delete-confirm p { margin-bottom: 8px; }
#camera-group-message { color: #a91e2a; }
#camera-name-message.is-error { color: #a91e2a; }
.camera-grid { display: grid; grid-template-columns: repeat(var(--camera-cols, 1), minmax(0, 1fr)); gap: 8px; }
.camera-grid[data-size="4"] { --camera-cols: 2; }
.camera-grid[data-size="9"] { --camera-cols: 3; }
.camera-grid[data-size="16"] { --camera-cols: 4; }
.camera-tile { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: #122e52; }
.camera-tile-title { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 42px; padding-inline: 8px; background: #fff; color: var(--deep-blue); font-weight: 600; }
.camera-tile-title span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.camera-tile-feed { position: relative; aspect-ratio: 16 / 10; }
.camera-grid[data-size="1"] .camera-tile-feed { max-height: 70svh; aspect-ratio: 16 / 9; }
.camera-tile video { display: block; width: 100%; height: 100%; object-fit: contain; }
.camera-tile-status { position: absolute; inset: 0; display: grid; place-content: center; gap: 6px; padding: 4px; text-align: center; color: #fff; font-size: 13px; }
.camera-focus, .camera-retry { min-height: 38px; padding-inline: 5px; border: 0; border-radius: 5px; color: inherit; background: transparent; font: inherit; cursor: pointer; }
.camera-focus:hover { background: var(--pale-blue); }
.camera-retry { justify-self: center; min-height: 30px; padding-inline: 8px; background: #ffffff20; }

.modules {
  display: grid;
  grid-template-columns: minmax(0, 1.13fr) minmax(0, 1fr);
  align-items: start;
  gap: 20px;
  margin-top: 20px;
}

.module {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 3px 9px #122e5208;
}

.module-heading { display: flex; align-items: center; gap: 12px; }
.module-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: none;
  place-items: center;
  border-radius: 12px;
  color: var(--blue);
  background: var(--pale-blue);
}

.module-icon .icon { width: 23px; height: 23px; }
.module-title { flex: 1; }
.module h2 { font-size: 24px; font-weight: 650; line-height: 1.12; letter-spacing: -.02em; }
.provider { margin-top: 3px; color: var(--muted); font-size: 13px; }
.count {
  flex: none;
  padding: 5px 10px;
  border-radius: 100px;
  background: #eef1f5;
  color: #495561;
  font-size: 13px;
  font-weight: 550;
}

.count.has-active { background: #e5f3eb; color: #1f643e; }
.scene-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-block: 18px 10px; }
.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
}

.button .icon { width: 17px; height: 17px; }
.button-primary { background: var(--red); color: #fff; }
.button-primary:hover:not(:disabled) { background: var(--red-hover); }
.button-secondary { background: #fff; border-color: var(--border); color: var(--deep-blue); }
.button-secondary:hover:not(:disabled) { background: var(--pale-blue); border-color: #b6c9de; }
.button:disabled { background: #edf0f4; color: #626a73; border-color: #e0e5ea; }

.light-list, .floor-list { list-style: none; padding: 0; margin: 0; }
.light-list li + li { border-top: 1px solid #e8ecf1; }
.light-row {
  display: grid;
  width: 100%;
  min-height: 59px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.light-row:focus-visible { outline-offset: -2px; }
.light-row:hover:not(:disabled) { background: #f6f9fc; }
.light-icon { margin-inline: 5px; color: var(--blue); }
.light-copy { display: grid; gap: 2px; font-size: 16px; font-weight: 550; line-height: 1.2; }
.light-state { color: var(--muted); font-size: 13px; font-weight: 400; }
.light-row[aria-checked="true"] .light-icon { color: #8c5506; fill: #fff0c6; }
.light-row[aria-checked="true"] .light-state { color: #246640; font-weight: 550; }
.switch-track {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 100px;
  background: #79899b;
}

.switch-track::after {
  position: absolute;
  content: "";
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 120ms ease-out;
}

.light-row[aria-checked="true"] .switch-track { background: var(--blue); }
.light-row[aria-checked="true"] .switch-track::after { transform: translateX(18px); }
.floor-intro { margin-block: 16px 12px; color: var(--muted); font-size: 15px; }
.floor-list { display: grid; gap: 8px; }
.floor-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 66px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafbfd;
}

.floor-number {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 9px;
  color: var(--deep-blue);
  background: var(--pale-blue);
  font-size: 18px;
  font-weight: 650;
}

.floor-name { font-size: 16px; font-weight: 550; line-height: 1.18; }
.floor-name small { display: block; margin-top: 3px; color: #765013; font-size: 12px; font-weight: 500; }
.floor-offline .floor-number { color: #4b5865; background: #edf0f4; }
.button-call { background: var(--blue); color: #fff; padding-inline: 11px; }
.button-call:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--deep-blue); }
.button-call[aria-disabled="true"] { cursor: wait; }
.button-call[aria-busy="true"] { background: var(--deep-blue); border-color: var(--deep-blue); color: #fff; }
.button-call[aria-busy="true"] .icon { visibility: hidden; }
.floor-selected { background: var(--pale-blue); border-color: #b6c9de; }
.call-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 11px;
  border-radius: 9px;
  color: var(--deep-blue);
  background: var(--pale-blue);
  font-size: 14px;
}

.call-note .icon { width: 17px; height: 17px; }
.lift-management { margin-top: 14px; border: 1px solid var(--border); border-radius: 12px; }
.lift-management summary {
  min-height: 44px;
  padding: 12px;
  color: var(--deep-blue);
  font-weight: 650;
  cursor: pointer;
}
.lift-management-body { display: grid; gap: 10px; padding: 0 12px 12px; }
.lift-floor-picker { font-size: 14px; font-weight: 600; }
.lift-management select {
  width: 100%;
  min-height: 44px;
  padding: 8px;
  border: 1px solid #aab9c8;
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}
.lift-management-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.lift-management-nav [aria-pressed="true"] { background: var(--pale-blue); border-color: var(--blue); }
#lift-management-message { color: var(--muted); font-size: 14px; }
.lift-management-list { list-style: none; margin: 0; padding: 0; }
.lift-management-list li { padding: 8px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.lift-management-list time { display: block; color: var(--muted); font-size: 14px; }
.lift-management-list .lift-history-heading { padding-top: 14px; }
.lift-history-heading h4 { margin: 0; color: var(--blue); font-size: 15px; }
.lift-history-details { margin-top: 3px; color: var(--muted); font-size: 14px; }
.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-block: 16px 4px;
  color: var(--muted);
  font-size: 13px;
}

[hidden], [data-mode="demo"] .live-only, [data-mode="live"] .demo-only { display: none !important; }
.live-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.live-actions a { text-decoration: none; }
#ewelink-tools { margin-top: 12px; }
.light-row:not([role="switch"]) .switch-track { visibility: hidden; }
.scene-feedback { margin-top: 10px; color: var(--muted); font-size: 14px; }
.scene-feedback:empty, .login-message:empty { display: none; }
[data-mode="demo"] .scene-feedback {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}

.login-page { max-width: 420px; }
.login-page h1 { color: var(--deep-blue); font-size: 30px; }
.login-page p { margin-top: 8px; color: var(--muted); }
.login-page .login-message { color: var(--red-hover); }
.login-form { display: grid; gap: 14px; margin-top: 20px; }
.login-form label { display: grid; gap: 5px; font-weight: 550; }
.login-form input {
  width: 100%; min-height: 44px; padding: 8px 10px;
  border: 1px solid #aab9c8; border-radius: 9px; font: inherit; font-size: 16px;
}

.noscript { margin-top: 14px; color: #765013; }

@media (max-width: 760px) {
  :root { --gutter: 12px; scroll-padding-top: 68px; }
  .topbar-inner { min-height: 60px; gap: 8px; }
  .wordmark { width: 176px; }
  main { padding-top: 12px; }
  .hero { min-height: 127px; padding: 18px; border-radius: 16px; }
  .hero-art { bottom: 0; opacity: .26; }
  .hero-description { font-size: 15px; }
  .module-nav {
    position: sticky;
    z-index: 2;
    top: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding-block: 10px 8px;
    background: var(--page);
  }
  .module-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--deep-blue);
    background: #fff;
    font-weight: 600;
    text-decoration: none;
  }
  .module-nav a:hover { background: var(--pale-blue); }
  .module-nav .icon { width: 17px; height: 17px; }
  .module-nav.has-cameras { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; gap: 6px; }
  .module-nav.has-cameras a { font-size: 14px; }
  .modules { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 4px; }
  .module { padding: 14px; border-radius: 15px; }
  .module-heading { gap: 9px; }
  .module-icon { width: 38px; height: 38px; border-radius: 10px; }
  .module-icon .icon { width: 21px; height: 21px; }
  .module h2 { font-size: 21px; }
  .count { padding-inline: 8px; font-size: 12px; }
  .scene-actions { margin-block: 13px 5px; }
  .light-row { min-height: 54px; }
}

@media (max-width: 580px) {
  .camera-tools .button { width: 100%; }
  .camera-groups .button { flex: 1 1 auto; width: auto; }
  .camera-group-field { flex-basis: 100%; }
  .camera-grid[data-size="9"], .camera-grid[data-size="16"] { --camera-cols: 2; }
  .camera-tile-title { font-size: 13px; }
}

.camera-view {
  background: #0a1728;
}

.camera-view .topbar, .camera-view .hero, .camera-view .module-nav, .camera-view .footer,
.camera-view .modules > .module:not(#telecamere),
.camera-view #telecamere .module-icon, .camera-view #telecamere .provider,
.camera-view .camera-groups > .button { display: none; }
.camera-view main.wrap { width: 100%; padding: 0; }
.camera-view .modules { display: block; margin: 0; }
.camera-view #telecamere {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100vh;
  height: 100dvh;
  padding: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right))
    max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
  overflow-y: auto;
  border: 0;
  border-radius: 0;
  background: #0a1728;
}
.camera-view #telecamere .module-heading { padding-inline: 6px 0; }
.camera-view #telecamere h2 { color: #fff; font-size: 21px; }
.camera-view-actions .button { min-width: 44px; }
.camera-view .camera-view-actions { display: flex; gap: 6px; margin-left: auto; }
.camera-view .camera-toolbar { display: flex; flex-wrap: wrap; gap: 6px; }
.camera-view .camera-tools { min-width: 0; flex: 1 1 165px; margin: 0; padding: 0; border: 0; gap: 6px; }
.camera-view .camera-tools label, .camera-view #camera-groups-status { color: #d9e7f6; }
.camera-view .camera-tools select { width: 100%; }
.camera-view .camera-playback { flex-basis: 360px; flex-wrap: nowrap; }
.camera-view .camera-playback .camera-field:nth-child(2) { flex: 1; }
.camera-view .camera-tools .button { width: auto; flex: none; }
.camera-view #camera-fullscreen-status { color: #d9e7f6; font-size: 14px; }
.camera-view .camera-grid { flex: 1; min-height: 140px; grid-auto-rows: minmax(0, 1fr); gap: 4px; }
.camera-view .camera-grid[data-size="9"] { --camera-cols: 3; }
.camera-view .camera-grid[data-size="16"] { --camera-cols: 4; }
.camera-view .camera-tile { display: flex; flex-direction: column; border-color: #293d55; border-radius: 6px; background: #050d17; }
.camera-view .camera-tile-title { min-height: 34px; padding-inline: 5px; background: #172a40; color: #fff; }
.camera-view .camera-grid .camera-tile-feed { flex: 1; min-height: 0; max-height: none; aspect-ratio: auto; }
.camera-view .camera-focus:hover { background: #344963; }
.camera-view .camera-grid:not([data-size="1"]) .camera-focus { min-height: 34px; }
.camera-view .camera-tile-status { gap: 1px; padding: 1px; font-size: clamp(10px, 2.5vw, 13px); overflow: auto; }

@media (prefers-reduced-motion: reduce) {
  .switch-track::after { transition: none; }
}
