/* Automation 06 live demo: the client's phone (ra-phone.css), the "Behind the scenes" log and
   the clinic panel (calendar, team inbox or consent log, and the campaign board). Stage chrome,
   controls and the tabs come from demo.css and site.css. Every rule is scoped under #demo and
   every class invented here starts with ra-. Layout: phone | log | clinic at 1280px and up;
   phone | carousel (Behind the scenes / Calendar + board) from 901px to 1279px; one column
   with the carousel below the phone at 900px and below. */

#demo [hidden] {
  display: none !important;
}

#demo .ra-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

#demo-stage {
  scroll-margin-top: calc(var(--topbar-h) + 24px);
}

/* The step caption wraps to two lines (no ellipsis), so the narration is never cut off */
#demo .demo-status {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

@media (min-width: 901px) {
  /* Two lines reserved beside the clock, so the bar does not jump between steps */
  #demo .demo-status {
    min-height: 2.6em;
  }
}

#demo .demo-status-text {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

#demo .demo-clock {
  max-width: 100%;
  min-width: 0;
  flex-wrap: wrap;
  row-gap: 4px;
  white-space: normal;
}

#demo .sec-title .gold-i {
  display: inline-block;
}

/* ---------- Tabs: four equal pills in one row; label and meta stacked in each pill ---------- */

#demo .ra-demo-bar {
  align-items: flex-start;
}

#demo .ra-demo-bar .tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

#demo .ra-demo-bar .tab {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 3px;
  align-items: center;
  padding: 12px 20px;
  text-align: left;
}

#demo .ra-demo-bar .tab-n {
  grid-row: 1 / span 2;
}

#demo .ra-demo-bar .tab-l,
#demo .ra-demo-bar .tab-m {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#demo .ra-demo-bar .tab-l {
  grid-column: 2;
  grid-row: 1;
}

#demo .ra-demo-bar .tab-m {
  grid-column: 2;
  grid-row: 2;
}

#demo .ra-demo-bar .demo-note {
  margin-left: auto;
}

@media (max-width: 1099px) {
  #demo .ra-demo-bar .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #demo .ra-demo-bar .demo-note {
    margin-left: 0;
  }
}

@media (max-width: 639px) {
  #demo .ra-demo-bar .tab {
    grid-template-rows: auto;
    row-gap: 0;
  }

  #demo .ra-demo-bar .tab-n {
    grid-row: auto;
  }

  #demo .ra-demo-bar .tab-l {
    grid-row: auto;
  }

  #demo .ra-demo-bar .tab-m {
    display: none;
  }

  #demo .ra-demo-bar .tab-l {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.2;
  }
}

/* ---------- Grid: phone column, then the side (log and clinic panel) ---------- */

#demo .ra-grid {
  --ra-chat-h: 600px;
  grid-template-columns: 300px minmax(0, 1fr);
}

#demo .ra-col-phone,
#demo .ra-col-log,
#demo .ra-col-clinic {
  min-width: 0;
}

#demo .ra-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 28px;
  align-items: stretch;
  height: calc(var(--ra-chat-h) + 52px);
  min-width: 0;
}

/* Label row (40px) + gap (12px) come first, so both panels end where the phone box ends */
#demo .ra-label {
  min-height: 40px;
}

#demo .ra-col-phone .ra-label {
  align-self: stretch;
}

#demo .ra-col-log,
#demo .ra-col-clinic {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#demo .ra-phonebox {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--ra-chat-h);
  --phone-fs: 13px;
}

#demo .ra-mini {
  display: none;
}

/* ---------- Phone controls: Text | Email switch (same look as 03's channel switch) ---------- */

#demo .ra-viewsw {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  padding: 3px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 999px;
}

#demo .ra-viewsw button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  box-sizing: border-box;
  padding: 0 12px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  color: var(--ash);
  transition: color 0.2s, background-color 0.2s;
}

#demo .ra-viewsw button svg {
  flex: none;
  width: 13px;
  height: 13px;
}

#demo .ra-viewsw button:hover {
  color: var(--bone);
}

#demo .ra-viewsw button[aria-pressed="true"] {
  background: var(--bone);
  color: var(--ink);
}

/* Gold dot on Email: a message arrived while the Text view was on; pressing Email clears it */
#demo .ra-viewsw button.has-dot::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

#demo .ra-demo-phone {
  flex: none;
}

/* Replay, Pause / Play and the speed switch share one line under the 300px phone column */
#demo .ra-col-phone .demo-controls {
  flex-wrap: nowrap;
  gap: 6px;
}

#demo .ra-col-phone .demo-ctl {
  gap: 6px;
  padding: 0 12px;
}

/* One playback control: Pause while running, Play when paused, Replay at the end. Its width is
   fixed, so the row never shifts when the label changes. */
#demo .ra-col-phone .demo-ctl[data-act="toggle"] {
  min-width: 118px;
}

#demo .ra-col-phone .demo-ctl .i-replay {
  display: none;
}

#demo .ra-col-phone .demo-ctl[data-mode="ended"] .i-pause,
#demo .ra-col-phone .demo-ctl[data-mode="ended"] .i-play {
  display: none;
}

#demo .ra-col-phone .demo-ctl[data-mode="ended"] .i-replay {
  display: block;
}

#demo .ra-col-phone .demo-speed button {
  min-width: 34px;
  padding: 0 7px;
}

/* Behind the scenes / Calendar + board switch: shown as a carousel switch from 901px to 900px-and-below */
#demo .demo-side-nav {
  display: none;
  gap: 2px;
  padding: 3px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 999px;
}

#demo .demo-side-nav button {
  position: relative;
  min-height: 32px;
  height: auto;
  box-sizing: border-box;
  padding: 0 14px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.2;
  color: var(--ash);
  white-space: nowrap;
}

#demo .demo-side-nav button[aria-pressed="true"] {
  background: var(--bone);
  color: var(--ink);
}

#demo .demo-side-nav button.has-dot::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Behind the scenes: one entry per step of the agent ---------- */

#demo .ra-log {
  flex: 1 1 0;
  min-height: 0;
  margin: 0;
  padding: 10px 16px 12px;
  list-style: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

#demo .ra-log-e {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
  animation: ra-log-in 0.35s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 120ms);
}

#demo .ra-log-e:first-child {
  border-top: 0;
}

#demo .ra-log-e.is-new::before {
  content: "";
  position: absolute;
  inset: 4px -10px;
  border: 1px solid rgb(255 255 255 / 0.45);
  border-radius: var(--r-lg);
  pointer-events: none;
  animation: ra-log-new 1.2s var(--ease-std) forwards;
}

#demo .ra-log-ic {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--elev);
  color: var(--ash);
}

#demo .ra-log-ic svg {
  width: 14px;
  height: 14px;
}

#demo .ra-log-b {
  min-width: 0;
}

#demo .ra-log-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

#demo .ra-log-t {
  min-width: 0;
  margin: 0;
  padding-top: 1px;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.4;
  color: var(--bone);
  overflow-wrap: anywhere;
}

#demo .ra-log-tm {
  flex: none;
  padding-top: 4px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1;
  letter-spacing: 0.08em;
  color: var(--ash);
  white-space: nowrap;
}

#demo .ra-log-done {
  color: var(--ok);
}

/* Icon colours by kind: fill, calendar, offer and summary are gold while they run, then green */
#demo .ra-log-e--client .ra-log-ic,
#demo .ra-log-e--intent .ra-log-ic,
#demo .ra-log-e--stop .ra-log-ic,
#demo .ra-log-e--optout .ra-log-ic,
#demo .ra-log-e--event .ra-log-ic,
#demo .ra-log-e--idle .ra-log-ic {
  color: var(--ash);
}

#demo .ra-log-e--fill .ra-log-ic,
#demo .ra-log-e--calendar .ra-log-ic,
#demo .ra-log-e--offer .ra-log-ic,
#demo .ra-log-e--summary .ra-log-ic {
  color: var(--accent);
}

#demo .ra-log-e--fill.is-done .ra-log-ic,
#demo .ra-log-e--calendar.is-done .ra-log-ic,
#demo .ra-log-e--offer.is-done .ra-log-ic,
#demo .ra-log-e--summary.is-done .ra-log-ic,
#demo .ra-log-e--send .ra-log-ic,
#demo .ra-log-e--mail .ra-log-ic,
#demo .ra-log-e--answer .ra-log-ic,
#demo .ra-log-e--record .ra-log-ic {
  color: var(--ok);
}

#demo .ra-log-e--booked .ra-log-ic {
  color: var(--ok);
  background: hsl(152 60% 48% / 0.12);
  border-color: hsl(152 60% 48% / 0.45);
}

#demo .ra-log-e--consent .ra-log-ic,
#demo .ra-log-e--guard .ra-log-ic {
  color: var(--info);
}

#demo .ra-log-e--handoff .ra-log-ic {
  color: var(--danger);
}

#demo .ra-log-e--idle {
  padding-top: 0;
}

#demo .ra-log-e--idle .ra-log-t {
  color: var(--ash);
}

/* Pending: three dots after the text and a 2px gold shimmer under it */
#demo .ra-log-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 5px;
  vertical-align: middle;
}

#demo .ra-log-dots i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  animation: ra-dot 1.2s ease-in-out infinite;
}

#demo .ra-log-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

#demo .ra-log-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

#demo .ra-log-shim {
  display: block;
  height: 2px;
  margin-top: 9px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--line) 0%, var(--accent) 50%, var(--line) 100%);
  background-size: 200% 100%;
  animation: ra-shim 1.4s linear infinite;
}

/* Cards under an entry: the document, the record, the template (fill) or the chips */
#demo .ra-doc,
#demo .ra-kv,
#demo .ra-fill {
  margin: 8px 0 0;
  padding: 8px 10px;
  background: var(--elev);
  border-radius: 0 6px 6px 0;
}

#demo .ra-doc,
#demo .ra-fill {
  border-left: 2px solid var(--accent);
}

#demo .ra-kv {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 14px;
  align-items: baseline;
  border-left: 2px solid var(--line);
}

#demo .ra-doc-t,
#demo .ra-fill-t,
#demo .ra-kv dt {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--ash);
}

#demo .ra-doc-t,
#demo .ra-fill-t {
  margin-bottom: 6px;
}

#demo .ra-doc-l {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--bone-70);
}

#demo .ra-doc-l + .ra-doc-l {
  margin-top: 4px;
}

#demo .ra-fill-p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--bone-70);
  overflow-wrap: anywhere;
}

/* A token starts as {field} and flips to its value: gold, the sans face, a gold underline */
#demo .ra-tok {
  display: inline;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ash);
}

#demo .ra-tok.is-on {
  padding: 0 2px;
  border-color: transparent;
  background: rgb(255 255 255 / 0.1);
  font-family: var(--font-sans);
  font-size: 14.5px;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
  animation: ra-tok-in 0.3s var(--ease-std) both;
}

#demo .ra-kv dd {
  min-width: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
  color: var(--bone);
  overflow-wrap: anywhere;
}

#demo .ra-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

#demo .ra-chip-m {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 11.5px;
  line-height: 1.3;
  letter-spacing: 0.04em;
  color: var(--bone-70);
}

/* ---------- Clinic panel: the view (calendar, inbox, consent log) above the campaign board ---------- */

#demo .ra-clinic {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#demo .ra-view {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

#demo .ra-view-tabs {
  flex: none;
  display: flex;
  gap: 16px;
  padding: 12px 14px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

/* Plain status label that names the view on show (not a tab: no underline, no active state) */
#demo .ra-view-tabs span {
  padding-bottom: 10px;
  margin-bottom: -1px;
  color: var(--bone-70);
}

#demo .ra-view-body {
  flex: 1 1 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent 100%);
}

#demo .ra-cal-head,
#demo .ra-vhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}

#demo .ra-vhead-l,
#demo .ra-vhead-r {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
}

#demo .ra-vhead-l {
  color: var(--bone);
}

#demo .ra-vhead-r {
  color: var(--ash);
  white-space: nowrap;
}

#demo .ra-cal-who {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

#demo .ra-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--elev);
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--bone);
}

#demo .ra-cal-names {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

#demo .ra-cal-name {
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.2;
  color: var(--bone);
}

#demo .ra-cal-day {
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: 0.04em;
  color: var(--ash);
  white-space: nowrap;
}

#demo .ra-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 10px;
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--ash);
}

#demo .ra-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

#demo .ra-sw {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

#demo .ra-sw--booked {
  background: var(--elev);
  border: 1px solid var(--line);
}

#demo .ra-sw--free {
  border: 1px dashed hsl(34 10% 26%);
}

#demo .ra-sw--react {
  background: hsl(152 60% 48% / 0.2);
  border: 1px solid hsl(152 60% 48% / 0.7);
}

#demo .ra-slots {
  padding: 0 14px 12px;
}

#demo .ra-slot {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 38px;
  border-top: 1px solid var(--line-soft);
}

#demo .ra-slot:first-child {
  border-top: 0;
}

#demo .ra-slot-t {
  font-size: 12px;
  line-height: 1;
  text-align: right;
  color: var(--ash);
  white-space: nowrap;
}

#demo .ra-blk {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-sizing: border-box;
  height: 30px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--elev);
  font-size: 14.5px;
  color: var(--bone-70);
}

#demo .ra-blk-l {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#demo .ra-blk-m {
  flex: none;
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--ash);
}

#demo .ra-blk--free {
  background: transparent;
  border: 1px dashed hsl(34 10% 26%);
}

#demo .ra-blk-free {
  font-size: 14px;
  color: var(--ash);
}

#demo .ra-blk--offered {
  border: 1px solid var(--accent);
  background: rgb(255 255 255 / 0.08);
}

#demo .ra-blk--offered .ra-blk-l {
  font-size: 14px;
  color: var(--accent);
}

#demo .ra-blk--offered.is-pulse {
  animation: ra-ring 1.2s var(--ease-std) 2;
}

#demo .ra-blk--react {
  border: 1px solid hsl(152 60% 48% / 0.7);
  background: hsl(152 60% 48% / 0.14);
  box-shadow: inset 3px 0 0 var(--ok);
  color: var(--bone);
}

#demo .ra-blk--react .ra-blk-l b {
  font-weight: 600;
  color: var(--bone);
}

#demo .ra-blk-tag {
  flex: none;
  padding: 2px 6px;
  border: 1px solid hsl(152 60% 48% / 0.5);
  border-radius: 3px;
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--ok);
}

#demo .ra-blk--react.is-enter {
  animation: ra-blk-in 0.7s var(--ease-out) both, ra-blk-glow 1.6s ease-out both;
}

/* Team inbox */

#demo .ra-ilist {
  flex: 1 1 0;
  min-height: 0;
  padding: 6px 14px 14px;
  overflow: hidden;
}

#demo .ra-irow {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line-soft);
}

#demo .ra-irow:first-child {
  border-top: 0;
}

#demo .ra-irow-av {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--elev);
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 1;
  color: var(--bone-70);
}

#demo .ra-irow-main {
  min-width: 0;
}

#demo .ra-irow-t {
  display: block;
  font-size: 15px;
  line-height: 1.3;
  color: var(--bone);
  overflow-wrap: anywhere;
}

#demo .ra-irow-m {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--ash);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#demo .ra-irow-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

#demo .ra-irow-ago {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ash);
}

#demo .ra-chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ash);
}

#demo .ra-chip--done {
  color: var(--ok);
  border-color: hsl(152 60% 48% / 0.4);
}

#demo .ra-chip--ok {
  color: var(--info);
  border-color: hsl(214 85% 66% / 0.45);
}

#demo .ra-chip--out {
  color: var(--ash);
  border-color: var(--line);
}

/* Callback card: 03's ticket anatomy, red edge, priority chip, summary and suggested action */
#demo .ra-ticket {
  margin: 8px 0 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--danger);
  border-radius: var(--r-lg);
  background: hsl(0 70% 52% / 0.06);
  animation: ra-ticket-in 0.5s var(--ease-out) both;
}

#demo .ra-ticket.is-glow {
  animation: ra-ticket-in 0.5s var(--ease-out) both, ra-ticket-glow 1.6s ease-out both;
}

#demo .ra-ticket-h {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

#demo .ra-ticket-pri {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border: 1px solid hsl(0 70% 56% / 0.5);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--danger);
}

#demo .ra-ticket-t {
  margin: 0;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--bone);
}

#demo .ra-ticket-who {
  margin: 6px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  line-height: 1.5;
  color: var(--ash);
  overflow-wrap: anywhere;
}

#demo .ra-ticket-f {
  margin-top: 12px;
}

#demo .ra-ticket-k {
  display: block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--ash);
}

#demo .ra-ticket-v {
  margin: 4px 0 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--bone);
}

#demo .ra-ticket-v--soft {
  color: var(--bone-70);
}

#demo .ra-ticket-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

#demo .ra-attach {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  line-height: 1.4;
  color: var(--ash);
}

#demo .ra-attach svg {
  flex: none;
  width: 13px;
  height: 13px;
}

#demo .ra-assign {
  flex: none;
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  color: var(--bone);
  cursor: default;
}

/* Consent log */

#demo .ra-clist {
  flex: 1 1 0;
  min-height: 0;
  padding: 0 14px 14px;
  overflow: hidden;
}

#demo .ra-pill {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--bone-70);
  white-space: nowrap;
}

#demo .ra-crow {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}

#demo .ra-crow:first-child {
  border-top: 0;
}

#demo .ra-crow.is-new {
  animation: ra-crow-in 0.5s var(--ease-out) both, ra-crow-gold 1.6s ease-out both;
}

#demo .ra-crow-time {
  font-size: 12px;
  line-height: 1.3;
  color: var(--ash);
  white-space: nowrap;
}

#demo .ra-crow-main {
  min-width: 0;
}

#demo .ra-crow-who {
  display: block;
  font-size: 15px;
  line-height: 1.3;
  color: var(--bone);
}

#demo .ra-crow-ev {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.35;
  color: var(--bone-70);
  overflow-wrap: anywhere;
}

/* ---------- Campaign board: Contacted, Replied, Booked, and the opted-out counter ---------- */

#demo .ra-board {
  flex: none;
  display: flex;
  flex-direction: column;
  height: 256px;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

#demo .ra-board-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--bone);
}

#demo .ra-board-sub {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--ash);
  text-align: right;
  white-space: nowrap;
}

#demo .ra-bcols {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#demo .ra-bcol {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

#demo .ra-bcol + .ra-bcol {
  border-left: 1px solid var(--line-soft);
}

#demo .ra-bcol-h {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  flex: none;
  height: 58px;
  box-sizing: border-box;
  padding: 0 12px;
}

#demo .ra-bcol-l {
  font-size: 11.5px;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--ash);
}

#demo .ra-bcol-list {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 8px 8px;
  overflow: hidden;
}

#demo .ra-barrow {
  position: absolute;
  top: 29px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  font-size: 11px;
  line-height: 1;
  color: var(--ash);
  transform: translate(-50%, -50%);
}

#demo .ra-bcard {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--elev);
}

#demo .ra-bcard.is-me {
  border-color: rgb(255 255 255 / 0.55);
  box-shadow: inset 2px 0 0 var(--accent);
}

#demo .ra-bcard.is-booked {
  border-color: hsl(152 60% 48% / 0.5);
  box-shadow: inset 2px 0 0 var(--ok);
}

#demo .ra-bcard.is-enter {
  animation: ra-bcard-in 0.45s var(--ease-out) both;
}

#demo .ra-bcard.is-out {
  opacity: 0;
  transform: translateY(4px) scale(0.96);
  transition: opacity 0.5s var(--ease-std), transform 0.5s var(--ease-std);
}

#demo .ra-bav {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  font-family: var(--font-display);
  font-size: 12px;
  line-height: 1;
  color: var(--bone-70);
}

#demo .ra-bbody {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

#demo .ra-bnrow {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

#demo .ra-bname {
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--bone);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#demo .ra-btag {
  flex: none;
  padding: 1px 4px;
  border: 1px solid hsl(214 85% 66% / 0.45);
  border-radius: 3px;
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--info);
  white-space: nowrap;
}

/* Segment on the card line, practitioner on the line under it. Nothing is clipped, 9.5px minimum */
#demo .ra-bmeta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  min-width: 0;
  font-size: 11.5px;
  line-height: 1.3;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bone-70);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#demo .ra-bwho {
  display: block;
  min-width: 0;
  margin-top: 1px;
  font-size: 11.5px;
  line-height: 1.3;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ash);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#demo .ra-bok {
  color: var(--ok);
}

#demo .ra-bfoot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
}

#demo .ra-bfoot-l {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--ash);
}

#demo .ra-bfoot-i {
  display: grid;
  place-items: center;
}

#demo .ra-bfoot-i svg {
  display: block;
  width: 13px;
  height: 13px;
}

/* Rolling numbers */

#demo .ra-count {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  line-height: 1.1;
  color: var(--bone);
}

#demo .ra-count--board {
  font-size: 22px;
}

#demo .ra-count--board.is-ok {
  color: var(--ok);
}

#demo .ra-count--foot {
  font-size: 17.5px;
  color: var(--bone-70);
}

#demo .ra-roll {
  position: relative;
  display: block;
  height: 1.1em;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

#demo .ra-roll-v {
  display: block;
}

#demo .ra-roll-v.is-out {
  position: absolute;
  left: 0;
  top: 0;
  animation: ra-roll-out 0.45s var(--ease-out) forwards;
}

#demo .ra-roll-v.is-in {
  animation: ra-roll-in 0.45s var(--ease-out) both;
}

#demo .ra-plus {
  position: absolute;
  left: calc(100% + 6px);
  top: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--accent);
  pointer-events: none;
  animation: ra-plus-up 0.9s var(--ease-out) forwards;
}

/* ---------- Caption, after-link ---------- */

#demo .ra-demo-caption {
  min-height: calc(1.5em * 2);
  margin: 16px 0 0;
  max-width: 60ch;
  font-size: 14px;
  letter-spacing: 0.02em;
  line-height: 1.5;
  text-transform: none;
  color: var(--bone-70);
}

#demo .ra-demo-caption.is-off {
  visibility: hidden;
}

#demo .demo-after {
  margin-top: 8px;
}

#demo .demo-after .link-mono {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 12px 0;
}

/* ---------- 1280px and up: phone box 600px, log and clinic panel end where it ends ---------- */

@media (min-width: 1280px) {
  #demo .ra-phonebox {
    --phone-fs: 13px;
  }
}

/* ---------- 901 to 1279px: phone | carousel (Behind the scenes or Calendar + board) ---------- */

@media (max-width: 1279px) {
  #demo .ra-grid {
    --ra-chat-h: 560px;
    grid-template-columns: 292px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    row-gap: 12px;
    column-gap: 28px;
  }

  #demo .ra-col-phone {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  #demo .ra-col-phone .ra-label {
    gap: 8px;
  }

  #demo .ra-col-phone .ra-label > .mono {
    white-space: nowrap;
  }

  #demo .ra-col-phone .ra-viewsw button {
    padding: 0 9px;
  }

  #demo .ra-phonebox {
    --phone-fs: 12px;
  }

  #demo .demo-side-nav {
    display: inline-flex;
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
    align-self: start;
    height: 40px;
    align-items: center;
  }

  #demo .ra-side {
    display: flex;
    grid-column: 2;
    grid-row: 2;
    gap: 0;
    height: var(--ra-chat-h);
    overflow: hidden;
  }

  #demo .ra-side > .demo-col {
    flex: none;
    width: 100%;
    transition: transform 0.6s var(--ease-out), visibility 0.6s;
  }

  /* Both panels move: the row slides left by one panel width to show the clinic panel */
  #demo .ra-side[data-show="clinic"] > .demo-col {
    transform: translateX(-100%);
  }

  #demo .ra-side[data-show="clinic"] > .ra-col-log {
    visibility: hidden;
  }

  #demo .ra-side:not([data-show="clinic"]) > .ra-col-clinic {
    visibility: hidden;
  }
}

@media (max-width: 1279px) and (min-width: 901px) {
  #demo .demo-side-nav button {
    min-height: 32px;
  }
}

/* ---------- 900px and below: one column, the carousel under the phone ---------- */

@media (max-width: 900px) {
  #demo .ra-grid {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 20px;
  }

  #demo .ra-col-phone {
    grid-column: auto;
    grid-row: auto;
  }

  #demo .ra-phonebox {
    --phone-fs: 12px;
  }

  #demo .demo-side-nav {
    display: inline-flex;
    grid-column: auto;
    grid-row: auto;
    justify-self: center;
    height: auto;
  }

  #demo .ra-side {
    grid-column: auto;
    grid-row: auto;
    height: calc(var(--ra-chat-h) + 52px);
  }

  #demo .ra-side > .demo-col {
    transition: transform 0.6s var(--ease-out), visibility 0.6s;
  }
}

/* Phones: the Text | Email switch drops under the label when there is no room beside it */
@media (max-width: 480px) {
  #demo .ra-label {
    flex-wrap: wrap;
    row-gap: 8px;
    min-height: 0;
  }

  #demo .ra-label > .ra-viewsw {
    max-width: 100%;
  }
}

/* ---------- 640px and below: panels grow with their content, one-line status above the carousel ---------- */

@media (max-width: 640px) {
  #demo .ra-grid {
    --ra-chat-h: 520px;
  }

  #demo .ra-phonebox {
    --phone-fs: 11.25px;
  }

  #demo .ra-mini {
    display: block;
    order: 2;
    margin: 0;
    padding: 0 2px 10px;
    min-width: 0;
    font-size: 12.5px;
    letter-spacing: 0.04em;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--ash);
  }

  #demo .ra-side {
    order: 3;
    height: auto;
  }

  #demo .ra-log {
    flex: none;
    min-height: 420px;
    overflow: visible;
  }

  #demo .ra-clinic {
    flex: none;
  }

  #demo .ra-view {
    flex: none;
    min-height: 330px;
  }

  #demo .ra-view-body {
    flex: 1 1 auto;
  }

  #demo .ra-board {
    flex: none;
  }

  /* Phones: the narrow board columns wrap a long name or segment instead of clipping it */
  #demo .ra-bav {
    display: none;
  }

  #demo .ra-bname,
  #demo .ra-bmeta,
  #demo .ra-bwho {
    white-space: normal;
  }

  #demo .ra-ilist,
  #demo .ra-clist {
    flex: none;
    overflow: visible;
  }

  #demo .ra-ticket-foot {
    gap: 8px;
  }
}

/* Touch: bigger targets for the switches */
@media (pointer: coarse) {
  #demo .ra-viewsw button,
  #demo .demo-side-nav button {
    min-height: 40px;
  }
}

/* Phones: every switch and speed button is at least 44px high (and the speed buttons 44px wide) */
@media (max-width: 600px) {
  #demo .ra-viewsw button,
  #demo .demo-side-nav button,
  #demo .ra-col-phone .demo-speed button {
    min-height: 44px;
  }

  #demo .ra-col-phone .demo-speed button {
    min-width: 44px;
  }
}

@media (max-width: 480px) {
  #demo .demo-clock {
    font-size: 12px;
    letter-spacing: 0.1em;
  }

  #demo .demo-clock-state {
    padding-left: 0;
    border-left: 0;
    width: 100%;
  }
}

/* ---------- Keyframes ---------- */

@keyframes ra-log-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@keyframes ra-log-new {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes ra-dot {
  0%,
  60%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@keyframes ra-shim {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

@keyframes ra-tok-in {
  from {
    opacity: 0.2;
    filter: blur(2px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes ra-roll-out {
  to {
    opacity: 0;
    transform: translateY(-100%);
  }
}

@keyframes ra-roll-in {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
}

@keyframes ra-plus-up {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-14px);
  }
}

@keyframes ra-bcard-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@keyframes ra-blk-in {
  from {
    opacity: 0;
    transform: translateX(18px) scale(0.97);
  }
}

@keyframes ra-blk-glow {
  from {
    box-shadow: inset 3px 0 0 var(--ok), 0 0 0 5px hsl(152 60% 48% / 0.35);
  }
  to {
    box-shadow: inset 3px 0 0 var(--ok), 0 0 0 0 hsl(152 60% 48% / 0);
  }
}

@keyframes ra-ring {
  0% {
    box-shadow: 0 0 0 0 rgb(255 255 255 / 0.45);
  }
  100% {
    box-shadow: 0 0 0 6px rgb(255 255 255 / 0);
  }
}

@keyframes ra-crow-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@keyframes ra-crow-gold {
  from {
    box-shadow: inset 2px 0 0 0 var(--accent);
  }
  to {
    box-shadow: inset 2px 0 0 0 transparent;
  }
}

@keyframes ra-ticket-in {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
}

@keyframes ra-ticket-glow {
  from {
    box-shadow: 0 0 0 1px hsl(0 70% 52% / 0.5), 0 0 28px -6px hsl(0 70% 52% / 0.45);
  }
  to {
    box-shadow: 0 0 0 1px hsl(0 70% 52% / 0), 0 0 28px -6px hsl(0 70% 52% / 0);
  }
}

/* ---------- Static (seeked finished state) and reduced motion: nothing animates ---------- */

#demo .ra-demo-stage.is-static *,
#demo .ra-demo-stage.is-static *::before,
#demo .ra-demo-stage.is-static *::after {
  transition: none !important;
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  #demo .ra-demo-stage *,
  #demo .ra-demo-stage *::before,
  #demo .ra-demo-stage *::after {
    transition: none !important;
    animation: none !important;
  }
}
