/* 1a — discovery: list · map · inspector */

.screen {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
}

/* --- left column header --------------------------------------------------- */

.list__header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 18px 14px;
}

.list__head-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.list__head-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.list__count-row {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.list__count {
  font: 800 28px/1 var(--font-display);
  letter-spacing: -0.035em;
}

.list__critical {
  display: flex;
  align-items: center;
  gap: 5px;
  font: 500 9px/1 var(--font-mono);
  letter-spacing: 1.2px;
  white-space: nowrap;
  color: var(--live-light);
}

/* --- rows ---------------------------------------------------------------- */

.list__rows { display: flex; flex-direction: column; }

.row {
  display: flex;
  gap: 11px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--rowline);
  cursor: pointer;
  transition: background var(--dur-hover) var(--ease-out);
}

.row:hover { background: rgba(237, 235, 230, 0.04); }

/* Inset rail so the selection cannot be clipped by a rounded corner. */
.row[aria-selected="true"] {
  background: linear-gradient(90deg, color-mix(in srgb, var(--tint) 10%, transparent), transparent 66%);
  box-shadow: inset 3px 0 0 var(--tint);
}

.row[data-severity="cam"] { opacity: 0.78; }
.row[data-severity="cam"]:hover,
.row[data-severity="cam"][aria-selected="true"] { opacity: 1; }

.row__rail {
  width: 34px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.row__age {
  font: 500 8.5px/1 var(--font-mono);
  color: var(--bone55);
  text-transform: uppercase;
}

.row__dot {
  border-radius: 50%;
  background: var(--tint);
  box-shadow: 0 0 10px color-mix(in srgb, var(--tint) 80%, transparent);
  flex-shrink: 0;
}

.row__dot--square { border-radius: 1px; }
.row__dot--breathe { animation: sp-breathe var(--breathe-dur) ease-in-out infinite; }

.row__line {
  width: 1px;
  flex: 1;
  background: linear-gradient(color-mix(in srgb, var(--tint) 36%, transparent), var(--hairline));
}

.row__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.row__title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.row__lead {
  font: 800 20px/1 var(--font-display);
  letter-spacing: -0.035em;
  flex-shrink: 0;
}

.row__lead--solo {
  font-size: 15px;
  letter-spacing: -0.02em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row__place {
  font: 800 14px/1 var(--font-display);
  letter-spacing: -0.015em;
}

.row__meta {
  font: 500 8.5px/1 var(--font-mono);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--bone55);
}

.row > button { align-self: center; flex-shrink: 0; }

/* --- inspector ----------------------------------------------------------- */

.inspector { min-height: 0; }

.inspector__strip { flex-shrink: 0; }

.strip__meta {
  font: 500 9px/1 var(--font-mono);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--bone50);
  min-width: 0;
}

.inspector__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
}

/* Sections are rebuilt independently, so the preview between them survives. */
.inspector__slot {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.inspector__slot:empty { display: none; }

.inspector__title {
  display: flex;
  align-items: stretch;
  gap: 13px;
}

.inspector__rail {
  width: 3px;
  flex-shrink: 0;
  border-radius: 2px;
  background: var(--tint);
  box-shadow: 0 0 12px color-mix(in srgb, var(--tint) 70%, transparent);
}

.inspector__title-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inspector__title-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.inspector__lead {
  font: 900 40px/1 var(--font-display);
  letter-spacing: -0.045em;
  flex-shrink: 0;
}

.inspector__place {
  font: 800 18px/1.05 var(--font-display);
  letter-spacing: -0.025em;
}

.inspector__detail {
  font: 500 9.5px/1.5 var(--font-mono);
  letter-spacing: 1px;
  color: var(--bone62);
}

.inspector__block {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.block-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.block-head__label {
  font: 500 8.5px/1 var(--font-mono);
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--bone45);
  white-space: nowrap;
}

.block-head__value {
  font: 500 8.5px/1 var(--font-mono);
  letter-spacing: 1.2px;
  white-space: nowrap;
}


/* --- drawer preview ------------------------------------------------------- */

/* A phone-shaped viewport: the remote feed is 9:16, so the drawer shows it at its
   own aspect ratio rather than a letterboxed strip. It scrolls with the body, but
   lives in its own slot so a re-render never restarts playback. */
.preview {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: var(--r-panel);
  overflow: hidden;
  background: var(--thumb);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 18px 44px rgba(0, 0, 0, 0.5);
}

.preview__media {
  position: absolute;
  inset: 0;
}

.preview__stripes {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(115deg, #1b2026 0 14px, #141a20 14px 28px);
}

.preview__video,
.preview__shot,
.preview__embed,
.preview__frozen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
  display: block;
}

/* The frame kept when the free window closes — dimmed, because it is a still. */
.preview__frozen { filter: saturate(0.7) brightness(0.55); }

.preview__badge {
  position: absolute;
  left: 12px;
  top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 11px;
  border-radius: 12px;
  font: 600 9px/1 var(--font-mono);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.preview__countdown {
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 9px 11px;
  border-radius: 12px;
  font: 600 9px/1 var(--font-mono);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--standby-light);
  font-variant-numeric: tabular-nums;
}

.preview__status {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: calc(100% - 32px);
  padding: 9px 12px;
  border-radius: var(--r-chip);
  background: rgba(8, 9, 11, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font: 500 9px/1.4 var(--font-mono);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--bone72);
  text-align: center;
}

.preview__status--alert {
  border-color: rgba(255, 128, 128, 0.42);
  color: var(--live-pale);
}

/* The paid continuation, offered over the frozen frame. */
.preview__gate {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px;
  background: linear-gradient(rgba(8, 9, 11, 0.35), rgba(8, 9, 11, 0.82));
}

.preview__gate-label {
  font: 500 9px/1 var(--font-mono);
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--bone72);
}

.preview__continue {
  width: 100%;
  padding: 16px 0;
  font-size: 11px;
  letter-spacing: 1.5px;
}

/* Provider attribution is not optional on a public cam. */
.preview__attribution {
  position: absolute;
  left: 12px;
  bottom: 10px;
  right: 12px;
  font: 500 8px/1.3 var(--font-mono);
  letter-spacing: 0.8px;
  color: var(--bone55);
  text-shadow: 0 1px 8px rgba(8, 9, 11, 0.9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- 6-bar histogram ----------------------------------------------------- */

.histogram {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 40px;
}

.histogram__bar {
  flex: 1;
  border-radius: 3px;
  background: rgba(237, 235, 230, 0.16);
}

.histogram__bar[data-tier="warm"] { background: rgba(245, 165, 36, 0.45); }
.histogram__bar[data-tier="hot"] { background: rgba(245, 165, 36, 0.65); }
.histogram__bar[data-tier="critical"] { background: rgba(255, 77, 77, 0.65); }

.histogram__bar[data-tier="current"] {
  background: var(--live-light);
  box-shadow: 0 0 12px rgba(255, 77, 77, 0.6);
}

/* --- agents in radius ---------------------------------------------------- */

.agent-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border-radius: var(--r-card);
  background: rgba(237, 235, 230, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.11);
  text-align: left;
  transition: background var(--dur-hover) var(--ease-out), border-color var(--dur-hover) var(--ease-out);
}

.agent-card:hover { background: rgba(237, 235, 230, 0.09); }

.agent-card--live {
  background: linear-gradient(150deg, rgba(255, 77, 77, 0.12), rgba(237, 235, 230, 0.05) 62%);
  border-color: rgba(255, 128, 128, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.agent-card__thumb {
  position: relative;
  width: 74px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--thumb);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.agent-card__stripes {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(115deg, #1b2026 0 11px, #141a20 11px 22px);
}

.agent-card__live {
  position: absolute;
  left: 6px;
  top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  font: 600 7px/1 var(--font-mono);
  letter-spacing: 0.8px;
  color: var(--live-pale);
}

.agent-card__live .dot { width: 5px; height: 5px; }

.agent-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.agent-card__name-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.agent-card__name {
  font: 800 16px/1 var(--font-display);
  letter-spacing: -0.02em;
}

.agent-card__meta {
  font: 500 8.5px/1 var(--font-mono);
  letter-spacing: 1px;
  color: var(--bone62);
}

.agent-card__distance {
  font: 500 8.5px/1 var(--font-mono);
  letter-spacing: 1px;
  color: var(--bone42);
}

/* --- pinned footer ------------------------------------------------------- */

.inspector__footer {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 0 20px 20px;
}

.inspector__actions {
  display: flex;
  gap: 9px;
}

.inspector__actions .btn--ghost { padding: 0 15px; }

.cta__caption {
  text-align: center;
  font: 500 8.5px/1.4 var(--font-mono);
  letter-spacing: 1.2px;
  color: var(--bone40);
}

/* A refused stream is the one caption that must not read as fine print: it sits
   right under the button that was just pressed. */
.cta__caption--error {
  padding: 11px 12px;
  border-radius: var(--r-chip);
  background: rgba(255, 77, 77, 0.15);
  border: 1px solid rgba(255, 128, 128, 0.42);
  font-size: 9.5px;
  line-height: 1.45;
  white-space: normal;
  color: var(--live-pale);
}

.btn--cam-ghost {
  background: rgba(107, 168, 255, 0.14);
  border-color: rgba(107, 168, 255, 0.4);
  color: var(--cam-light);
}
