/* ---------- Camera with a brain (product object on a light page) ---------- */
.cam { position: relative; inline-size: 100%; }

.cam-frame {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--device);
  box-shadow: var(--shadow-2);
  isolation: isolate;
}
.cam-img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; filter: saturate(0.9) contrast(1.03); }
.cam-frame::after { /* subtle CCTV texture */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.1) 0 1px, transparent 1px 3px);
}
.cam-overlay { position: absolute; inset: 0; z-index: 2; direction: ltr; }

.cam-hud {
  position: absolute; inset-block-start: 3.5%; inset-inline: 3%; z-index: 4;
  display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; direction: rtl;
  font-size: clamp(0.6875rem, 0.6rem + 0.3vw, 0.8125rem); font-weight: 500; color: var(--device-text);
}
.cam-hud > span { padding: 0.25em 0.65em; border-radius: 6px; background: rgba(20, 22, 27, 0.72); }
.cam-hud .cam-clock { font-family: var(--font-mono); font-variant-numeric: tabular-nums; direction: ltr; }

/* Zones */
.zone {
  position: absolute; left: var(--l); top: var(--t); width: var(--w); height: var(--h);
  border: 1.5px dashed rgba(255, 255, 255, 0.85); border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(20, 22, 27, 0.25), inset 0 0 0 1px rgba(20, 22, 27, 0.2);
  transition: border-color 400ms ease, background-color 400ms ease;
}
.zone-label {
  position: absolute; inset-block-end: 6px; inset-inline-start: 6px; direction: rtl;
  padding: 0.15em 0.55em; border-radius: 6px; white-space: nowrap;
  font-size: clamp(0.6875rem, 0.6rem + 0.3vw, 0.8125rem); font-weight: 600;
  background: rgba(20, 22, 27, 0.8); color: var(--device-text);
  transition: background-color 400ms ease, color 400ms ease;
}
[data-zone="fitting"] .zone-label { inset-block-end: auto; inset-block-start: 6px; inset-inline-start: auto; inset-inline-end: 6px; }
.zone.is-alert { border-style: solid; border-color: var(--fail); background: rgba(229, 83, 75, 0.12); }
.zone.is-alert .zone-label { background: var(--fail); color: #fff; }
.zone.is-ok { border-style: solid; border-color: var(--ok); background: rgba(63, 182, 122, 0.12); }
.zone.is-ok .zone-label { background: var(--ok); color: #06140c; }

/* People: anonymous blurred silhouettes */
.person {
  position: absolute; left: var(--x); top: var(--y); height: var(--ph, 30%); aspect-ratio: 0.4;
  transform: translate(-50%, -100%);
  transition: left 2.2s var(--ease-in-out), top 2.2s var(--ease-in-out), opacity 350ms ease;
}
.person.is-hidden { opacity: 0; }
.person svg { inline-size: 100%; block-size: 100%; filter: blur(2.2px); opacity: 0.92; color: rgba(26, 20, 16, 0.92); }
.person[data-role="staff"] svg { color: #18242e; }
.person .tag {
  position: absolute; inset-block-end: 102%; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 0.35em; white-space: nowrap; direction: rtl;
  padding: 0.2em 0.6em; border-radius: var(--radius-pill);
  font-size: clamp(0.6875rem, 0.6rem + 0.3vw, 0.8125rem); font-weight: 600;
  background: rgba(20, 22, 27, 0.82); color: var(--device-text);
  transition: background-color 400ms ease, color 400ms ease, opacity 300ms ease;
}
.person .tag .ti { font-size: 1.05em; }
.person .tag b { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.person.is-alert .tag { background: var(--fail); color: #fff; }
.person.is-ok .tag { background: var(--ok); color: #06140c; }
.person.tag-hidden .tag { opacity: 0; }

.cam-badge {
  position: absolute; inset-block-end: 4%; inset-inline-start: 3%; z-index: 4; direction: rtl;
  display: inline-flex; align-items: center; gap: 0.4em;
  padding: 0.3em 0.75em; border-radius: var(--radius-pill);
  font-size: clamp(0.6875rem, 0.6rem + 0.3vw, 0.8125rem); font-weight: 600;
  background: rgba(20, 22, 27, 0.78); color: var(--device-text);
}

/* ---------- Phone with the notification ---------- */
.phone {
  position: absolute; z-index: 5;
  inset-inline-end: -13%; inset-block-start: 6%; /* high enough that the notification lands above the fold */
  inline-size: clamp(150px, 14vw, 200px); aspect-ratio: 9 / 19;
  border-radius: 36px; padding: 8px;
  background: var(--device);
  box-shadow: var(--shadow-2), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}
.phone-screen {
  position: relative; inline-size: 100%; block-size: 100%; overflow: hidden; border-radius: 29px;
  background: linear-gradient(180deg, #2A2F3A 0%, #171A20 70%);
  color: var(--device-text); direction: rtl;
}
.phone-screen::before { content: ""; position: absolute; inset-block-start: 8px; left: 50%; transform: translateX(-50%); inline-size: 34%; block-size: 20px; border-radius: 999px; background: #000; }
.lock-date { position: absolute; inset-block-start: 10%; inset-inline: 0; text-align: center; font-size: 0.75rem; color: var(--device-muted); }
.lock-time { position: absolute; inset-block-start: 15%; inset-inline: 0; text-align: center; font-weight: 300; font-size: clamp(1.8rem, 2.6vw, 2.3rem); line-height: 1; direction: ltr; font-variant-numeric: tabular-nums; }

.notif {
  position: absolute; inset-block-start: 36%; inset-inline: 7px;
  padding: 0.6rem 0.65rem; border-radius: 14px;
  background: rgba(242, 244, 248, 0.94); color: var(--text);
  font-size: 0.75rem; line-height: 1.4;
  transition: opacity 300ms ease;
}
.notif.is-swapping { opacity: 0.35; }
.notif-head { display: flex; align-items: center; gap: 0.45rem; margin-block-end: 0.25rem; color: var(--muted); font-size: 0.6875rem; }
.notif-head time { margin-inline-start: auto; }
.app-icon {
  inline-size: 20px; block-size: 20px; border-radius: 6px; flex: none;
  display: grid; place-items: center; background: var(--brand); color: #fff;
  font-weight: 700; font-size: 0.5625rem; letter-spacing: 0.02em; direction: ltr;
}
.notif strong { display: flex; align-items: center; gap: 0.35rem; font-size: 0.8125rem; }
.notif strong::before { content: ""; inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--unknown); flex: none; }
.notif[data-state="ok"] strong::before { background: var(--ok); }
.notif[data-state="alert"] strong::before { background: var(--fail); }
.notif p { color: var(--muted); }

/* Mobile: the phone becomes a banner overlapping the bottom of the frame */
@media (max-width: 767px) {
  .cam-frame { border-radius: 14px; }
  .phone {
    position: relative; inset: auto; margin: 0.75rem 0 0;
    inline-size: auto; aspect-ratio: auto; padding: 0; border-radius: 16px; background: none; box-shadow: none;
  }
  .phone-screen { background: none; border-radius: 16px; overflow: visible; }
  .phone-screen::before, .lock-time, .lock-date { display: none; }
  .notif { position: relative; inset: auto; padding: 0.75rem 0.9rem; font-size: 0.8125rem; box-shadow: var(--shadow-2); background: #fff; }
  .cam-badge { padding: 0.2em 0.6em; }
  .person[data-role="customer"] { --ph: 25% !important; }
  .person[data-role="staff"] { --ph: 28% !important; }
  .cam-badge .badge-long { display: none; }
}

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