/* The Unblink app inside the warehouse case study's demo window, 1200 × 750.
 * Tokens and sizes follow zapdos-labs/unblink app/src (neu-* greys, Inter body,
 * Montserrat wordmark; SideBar.tsx, CameraView.tsx, EventPanel.tsx, EventsView.tsx).
 * Prefix: uwh-. */

.uwh-demo {
  --hd-font: 'Inter', system-ui, sans-serif;
  --hd-mono: 'JetBrains Mono', ui-monospace, monospace;
  margin: 0;
}
.uwh-stage {
  --n300: #d4d4d4;
  --n400: #a3a3a3;
  --n500: #737373;
  --n700: #404040;
  --n750: #343434;
  --n800: #262626;
  --n850: #1f1f1f;
  --n900: #171717;
  --n950: #0a0a0a;
  --violet: #8b5cf6;
  background: var(--n950);
  color: #fff;
  font: 400 16px/1.5 'Inter', system-ui, sans-serif;
  text-align: left;
}
.uwh-stage svg.uwh-ico {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.uwh-app {
  position: absolute;
  inset: 0;
  display: flex;
}
.uwh-main {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--n900);
}

/* Sidebar, folded to w-20 */
.uwh-side {
  flex: none;
  width: 80px;
  height: 750px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: var(--n900);
  border-right: 1px solid var(--n800);
}
.uwh-logo {
  display: flex;
  justify-content: center;
  height: 56px;
  margin: 16px 0 32px;
  align-items: center;
}
.uwh-tabs,
.uwh-services {
  display: grid;
  gap: 4px;
  margin: 0 8px 16px;
}
.uwh-services {
  margin-top: 48px;
}
.uwh-tab,
.uwh-service {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  border-radius: 12px;
  color: var(--n400);
}
.uwh-service {
  height: 36px;
}
.uwh-tab.uwh-on,
.uwh-service.uwh-on {
  background: var(--n800);
  color: #fff;
}
.uwh-rule {
  height: 1px;
  margin: 0 16px;
  background: var(--n800);
}
.uwh-hide {
  display: flex;
  justify-content: center;
  margin: auto 0 16px;
  color: var(--n500);
}

/* Camera view: feed + Events panel (w-[400px]) */
.uwh-camera {
  display: flex;
  height: 750px;
}
.uwh-feed {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.uwh-bar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 16px;
  border-bottom: 1px solid var(--n800);
  background: var(--n900);
}
.uwh-bar.uwh-end {
  justify-content: flex-end;
  padding: 0 8px;
}
.uwh-bar-name {
  font-size: 18px;
  font-weight: 500;
}
.uwh-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--n750);
  border-radius: 12px;
  background: var(--n800);
  font-size: 14px;
  line-height: 20px;
}
.uwh-video {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--n900);
}
/* The feed: the Higgsfield clip, with a recorder clock and the close-call tag on top */
.uwh-scene {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #050505;
}
.uwh-clip,
.uwh-clip-rec {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.uwh-osd {
  position: absolute;
  top: 14px;
  font: 600 13px 'JetBrains Mono', monospace;
  color: #fff;
  opacity: 0.85;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.8);
}
.uwh-osd-l { left: 16px; }
.uwh-osd-r {
  right: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
/* A recorder's live marker: red dot that blinks once a second */
.uwh-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
}
.uwh-live i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ef4444;
  animation: uwh-blink 1s steps(2, start) infinite;
}
@keyframes uwh-blink {
  to { visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .uwh-live i { animation: none; }
}
/* Marks the forklift and the person at the moment the rule fires */
.uwh-box {
  position: absolute;
  left: 42.5%;
  top: 55%;
  width: 19.5%;
  height: 40%;
  border: 2px solid #ef4444;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.4);
  opacity: 0;
}
.uwh-box span {
  position: absolute;
  left: -2px;
  bottom: 100%;
  margin-bottom: 4px;
  padding: 2px 6px;
  border-radius: 3px;
  background: #ef4444;
  font: 600 11px 'JetBrains Mono', monospace;
  color: #fff;
  white-space: nowrap;
}
.uwh-tag {
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--violet);
  font: 600 16px/22px 'Inter', sans-serif;
  color: #fff;
  opacity: 0;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.45);
}
.uwh-panel {
  flex: none;
  display: flex;
  flex-direction: column;
  width: 400px;
  border-left: 1px solid var(--n800);
  background: var(--n900);
  overflow: hidden;
}
.uwh-events {
  display: grid;
  gap: 16px;
  padding: 8px;
}
.uwh-event {
  padding: 16px;
  border-radius: 8px;
  background: var(--n850);
  box-shadow: 0 0 0 2px rgb(139 92 246 / calc(var(--glow, 0) * 0.9)), 0 0 32px rgb(139 92 246 / calc(var(--glow, 0) * 0.35));
}
.uwh-event-name {
  font-weight: 600;
}
.uwh-event-time {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 14px;
  line-height: 20px;
  color: var(--n400);
}
.uwh-event-what {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  font-size: 15px;
  line-height: 21px;
  color: #fff;
}
/* A clip chip: a still from the clip for the close call, a plain chip for the rest */
.uwh-thumb {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 72px;
  height: 42px;
  border-radius: 6px;
  background: var(--n800);
  color: #fff;
  font: 600 11px 'JetBrains Mono', monospace;
}
.uwh-thumb .uwh-ico { fill: currentColor; stroke: none; }
.uwh-thumb-img {
  background: center / cover url('/case-studies/demo/close-call.jpg?v=1d8b1099');
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.9);
}

/* Events view: header, table-fixed, pagination */
.uwh-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  padding: 16px 24px;
  border-bottom: 1px solid var(--n800);
}
.uwh-header h1 {
  margin: 0;
  font: 600 20px/28px 'Inter', sans-serif;
  letter-spacing: 0;
  color: #fff;
}
.uwh-header p {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--n400);
}
.uwh-scroll {
  flex: 1;
  overflow: hidden;
}
.uwh-loading {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--n400);
}
.uwh-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.uwh-table th {
  padding: 12px 24px;
  border-bottom: 1px solid var(--n800);
  background: var(--n850);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: var(--n400);
  text-align: left;
}
.uwh-table td {
  padding: 12px 24px;
  font-size: 14px;
  line-height: 20px;
  color: var(--n400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.uwh-table td.uwh-svc {
  color: var(--n300);
}
.uwh-table td.uwh-what {
  color: #fff;
}
.uwh-table td.uwh-sel {
  box-shadow: inset 0 0 0 2px var(--violet);
}
.uwh-table tr {
  border-bottom: 1px solid var(--n800);
}
.uwh-table tr.uwh-hover {
  background: rgb(38 38 38 / 0.5);
}
.uwh-table tr.uwh-fresh {
  background: rgb(139 92 246 / calc(var(--fresh, 0) * 0.16));
}
.uwh-pages {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  padding: 16px 24px;
  border-top: 1px solid var(--n800);
  background: var(--n850);
  font-size: 14px;
  color: var(--n400);
}
.uwh-pages span {
  display: flex;
  gap: 8px;
}
.uwh-pages i {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--n800);
  color: #fff;
}
.uwh-pages i.uwh-off {
  opacity: 0.5;
}

/* Cell modal: bg-neu-850, border-neu-700, w-[400px], max-h-96 */
.uwh-backdrop {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: rgb(0 0 0 / 0.5);
}
.uwh-modal {
  position: absolute;
  z-index: 5;
  left: 150px;
  top: 60px;
  width: 880px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--n700);
  border-radius: 8px;
  background: var(--n850);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.5);
}
.uwh-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--n700);
  color: var(--n400);
}
.uwh-modal-head h3 {
  margin: 0;
  font: 600 14px/20px 'Inter', sans-serif;
  letter-spacing: 0;
  color: #fff;
}
/* The record: clip on the left, the facts in sentences on the right */
.uwh-record {
  display: grid;
  grid-template-columns: 560px 1fr;
  gap: 20px;
  padding: 16px;
}
.uwh-record-clip {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  background: #050505;
}
.uwh-record dl {
  margin: 0;
  display: grid;
  gap: 4px;
  align-content: start;
}
.uwh-record dt {
  margin-top: 10px;
  font-size: 12px;
  line-height: 16px;
  color: var(--n400);
}
.uwh-record dt:first-child { margin-top: 0; }
.uwh-record dd {
  margin: 0;
  font-size: 15px;
  line-height: 21px;
  color: #fff;
}

/* Below the window */
.uwh-note {
  margin-top: 14px;
  font-size: 14px;
  color: var(--dim, #6a6a6a);
}
.uwh-backdrop,
.uwh-modal,
.uwh-loading {
  display: none;
}
.uwh-section h2 {
  margin: 10px 0 28px;
}
