/* The incoming call ribbon.
 *
 * Fixed to the top of the WINDOW rather than placed in a page, because the
 * whole point of it is that it outlives the route: an agent answers from
 * wherever they are, opens the seller's page to read the history, and the call
 * carries on in the same ribbon.
 *
 * Above everything, including the floating My To Do dock, which sits bottom
 * right at a lower layer. A ribbon a modal can cover is a ribbon that loses a
 * call.
 */
#call-ribbon {
  display: none;
}

#call-ribbon.on {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4000;
  background: #0f172a;
  color: #fff;
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.35);
}

.cr-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  max-width: 1400px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.cr-inner .spacer {
  flex: 1;
}

/* Pulses while it is ringing and sits still once the call is up, so a glance
   tells you which of the two states this is without reading the words. */
.cr-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  flex: none;
  animation: cr-pulse 1.1s ease-in-out infinite;
}

.cr-dot.live {
  background: #38bdf8;
  animation: none;
}

@keyframes cr-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

.cr-who {
  display: flex;
  align-items: baseline;
  gap: 9px;
  flex-wrap: wrap;
  min-width: 0;
}

.cr-who b {
  font-size: 14px;
}

.cr-num,
.cr-stage,
.cr-say {
  font-size: 12px;
  color: #cbd5e1;
}

.cr-stage {
  border: 1px solid #334155;
  border-radius: 999px;
  padding: 1px 8px;
}

.cr-say {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#call-ribbon .btn {
  flex: none;
}

#call-ribbon .btn.danger {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

/* The app is not pushed down by the ribbon, which would reflow every page
   under somebody mid-sentence. It overlays, and the app's own header is below
   it for the length of the call. */
@media (max-width: 640px) {
  .cr-inner {
    padding: 8px 10px;
    gap: 8px;
  }
  .cr-say {
    display: none;
  }
}
