
/* self-hosted-session-replay figures. This article-local stylesheet loads after resources.css.
   Replaces self-hosted-session-replay-architecture.svg and
   managed-vs-self-hosted-vs-hybrid-replay.svg; figure 2 is new. */

.sr-fig {
  margin: 38px 0;
  padding: 30px 32px 28px;
  border: 1px solid #cfdcf0;
  border-radius: 20px;
  background: #f4f7fb;
  color: #071b3a;
}

h3.sr-h {
  margin: 0 0 22px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: #071b3a;
}

p.sr-k {
  margin: 0 0 12px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5a6a80;
}

p.sr-note {
  margin: 16px 0 0;
  padding: 13px 16px;
  border-left: 4px solid #2f6df6;
  border-radius: 0 10px 10px 0;
  background: #fff;
  font-size: 14px;
  line-height: 1.5;
  color: #33465f;
  text-wrap: pretty;
}

p.sr-note em {
  font-style: normal;
  font-weight: 700;
  color: #071b3a;
}

.sr-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 26px;
  margin-top: 14px;
}

.sr-legend p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: #4b5b76;
}

.sr-sw {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.sr-sw--m { background: #fff; box-shadow: inset 0 0 0 3px #8a5a06; }
.sr-sw--s { background: #16408f; }

.sr-sw--span {
  width: 22px;
  height: 8px;
  border-radius: 4px;
  background: repeating-linear-gradient(-45deg, #b0bdcd 0 4px, #e6edf7 4px 8px);
  box-shadow: inset 0 0 0 1px #cfdcf0;
}

/* ---------- figure 1: architecture ---------- */

.sr-arch {
  display: grid;
  gap: 8px;
}

.sr-spine {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 20px;
}

.sr-node,
.sr-store {
  position: relative;
  display: grid;
  align-content: start;
  padding: 14px 16px 15px;
  border: 1px solid #d7e2f2;
  border-radius: 14px;
  background: #fff;
}

.sr-node--gate { border-left: 5px solid #2f6df6; }
.sr-node--play { border-left: 5px solid #17693f; }

p.sr-node__n {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin: 0 0 8px;
  border-radius: 50%;
  background: #071b3a;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
}

p.sr-node__t {
  margin: 0 0 5px;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.25;
  color: #071b3a;
  text-wrap: pretty;
}

p.sr-node__t em {
  display: block;
  font-size: 13px;
  font-style: normal;
  font-weight: 600;
  color: #5a6a80;
}

p.sr-node__d {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: #4b5b76;
  text-wrap: pretty;
}

.sr-go {
  position: absolute;
  display: none;
}

.sr-spine .sr-node:not(:last-of-type)::before {
  content: "";
  position: absolute;
  top: 34px;
  right: -20px;
  width: 9px;
  height: 3px;
  background: #8a94a6;
}

.sr-spine .sr-node:not(:last-of-type)::after {
  content: "";
  position: absolute;
  top: 28px;
  right: -13px;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 10px solid #8a94a6;
}

.sr-down {
  justify-self: center;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 9px solid #8a94a6;
}

.sr-stores {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.sr-manifest,
.sr-anti {
  margin-top: 12px;
  padding: 10px 12px 11px;
  border-radius: 10px;
}

.sr-manifest {
  background: #f4f7fb;
  box-shadow: inset 0 0 0 1px #dfe7f3;
}

p.sr-manifest__t {
  margin: 0 0 7px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #5a6a80;
}

.sr-chunks {
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  gap: 3px;
}

.sr-chunks i {
  display: block;
  height: 16px;
  border-radius: 3px;
  background: #2f6df6;
}

p.sr-manifest__d {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.35;
  color: #4b5b76;
  text-wrap: pretty;
}

.sr-anti {
  background: repeating-linear-gradient(-45deg, #fdf2dd 0 6px, #fdf9f1 6px 12px);
  box-shadow: inset 0 0 0 1px #e6cd9a;
}

p.sr-anti__x {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: #6b4e08;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

p.sr-anti__d {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.35;
  color: #6b4e08;
  text-wrap: pretty;
}

.sr-band {
  margin-top: 4px;
  padding: 14px 18px 15px;
  border: 1px solid #d7e2f2;
  border-left: 5px solid #17693f;
  border-radius: 14px;
  background: #fff;
}

p.sr-band__k {
  margin: 0 0 10px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #5a6a80;
}

.sr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sr-chips span {
  padding: 5px 12px;
  border-radius: 999px;
  background: #f4f7fb;
  box-shadow: inset 0 0 0 1px #dfe7f3;
  font-size: 13px;
  font-weight: 600;
  color: #33465f;
}

/* ---------- figure 2: capacity cascade ---------- */

.sr-cascade {
  display: grid;
  gap: 10px;
}

.sr-panel {
  padding: 16px 20px 18px;
  border: 1px solid #d7e2f2;
  border-radius: 16px;
  background: #fff;
}

p.sr-panel__d {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: #4b5b76;
  text-wrap: pretty;
}

.sr-narrow {
  display: grid;
  gap: 8px;
}

.sr-nrow {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

p.sr-nrow__t {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: #071b3a;
}

p.sr-nrow__t em {
  font-size: 13.5px;
  font-style: normal;
  font-weight: 600;
  color: #5a6a80;
}

.sr-nbar {
  display: flex;
  align-items: baseline;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 5px;
  background: #5a6a80;
  align-items: center;
}

.sr-nbar--rec { background: #16408f; }

.sr-nbar b {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.sr-nbar span {
  font-size: 13px;
  font-weight: 600;
  color: #e6edf7;
}

.sr-fan {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.sr-panel--bytes { border-top: 4px solid #2f6df6; }
.sr-panel--objects { border-top: 4px solid #8a5a06; }
.sr-panel--requests { border-top: 4px solid #17693f; }

ol.sr-chain {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

ol.sr-chain li {
  position: relative;
  padding: 10px 13px 11px;
  border-radius: 10px;
  background: #f4f7fb;
  box-shadow: inset 0 0 0 1px #dfe7f3;
}

ol.sr-chain li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 24px;
  bottom: -7px;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 8px solid #8a94a6;
  z-index: 1;
}

ol.sr-chain li.sr-chain__last {
  background: #eaf1fe;
  box-shadow: inset 0 0 0 1px #c6d9fb;
}

p.sr-chain__t {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  color: #071b3a;
  text-wrap: pretty;
}

p.sr-chain__f {
  margin: 3px 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.35;
  color: #4b5b76;
  overflow-wrap: anywhere;
}

p.sr-chain__v {
  margin: 6px 0 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: #16408f;
  font-variant-numeric: tabular-nums;
}

p.sr-chain__v em {
  margin-left: 5px;
  font-size: 13.5px;
  font-style: normal;
  font-weight: 700;
  color: #5a6a80;
}

.sr-panel--peak { border-top: 4px solid #071b3a; }

.sr-peak {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.sr-pk {
  padding: 12px 14px 13px;
  border-radius: 12px;
  background: #f4f7fb;
  box-shadow: inset 0 0 0 1px #dfe7f3;
}

.sr-pk--out {
  background: #eaf1fe;
  box-shadow: inset 0 0 0 1px #c6d9fb;
}

p.sr-pk__t {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  color: #4b5b76;
  text-wrap: pretty;
}

p.sr-pk__v {
  margin: 6px 0 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  color: #071b3a;
  font-variant-numeric: tabular-nums;
}

p.sr-pk__v em {
  margin-left: 4px;
  font-size: 13.5px;
  font-style: normal;
  font-weight: 700;
  color: #5a6a80;
}

.sr-pk--out p.sr-pk__v { color: #16408f; }

i.sr-pk__op {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  font-style: normal;
  font-weight: 700;
  color: #5a6a80;
  white-space: nowrap;
}

p.sr-caveat {
  margin: 0;
  padding: 13px 16px;
  border-left: 4px solid #b8860b;
  border-radius: 0 10px 10px 0;
  background: #fdf9f1;
  font-size: 14px;
  line-height: 1.5;
  color: #6b4e08;
  text-wrap: pretty;
}

/* ---------- figure 3: boundary travel ---------- */

.sr-travel {
  padding: 4px 22px 18px;
  border: 1px solid #d7e2f2;
  border-radius: 16px;
  background: #fff;
}

.sr-tv__axis,
.sr-tv__row {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.sr-tv__axis {
  padding: 14px 0 10px;
  border-bottom: 2px solid #071b3a;
}

.sr-tv__axis {
  grid-template-columns: 260px minmax(0, 1fr) minmax(0, 1fr);
}

.sr-tv__row { padding: 5px 0; }

p.sr-tv__corner,
p.sr-tv__end {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5a6a80;
}

p.sr-tv__end--r { text-align: right; }

p.sr-tv__layer {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: #071b3a;
  text-wrap: pretty;
}

.sr-tv__track {
  position: relative;
  height: 22px;
  margin-right: 9px;
  margin-left: 9px;
}

.sr-tv__track::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -9px;
  right: -9px;
  height: 1px;
  margin-top: -0.5px;
  background: #eef2f8;
}

.sr-tv__span {
  position: absolute;
  top: 50%;
  height: 8px;
  margin-top: -4px;
  border-radius: 4px;
  background: repeating-linear-gradient(-45deg, #b0bdcd 0 4px, #e6edf7 4px 8px);
  box-shadow: inset 0 0 0 1px #cfdcf0;
}

i.sr-dot {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
}

.sr-dot--m {
  background: #fff;
  box-shadow: 0 0 0 3px #8a5a06 inset;
}

.sr-dot--s { background: #16408f; }

.sr-dot--both {
  background: #16408f;
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px #8a5a06;
}

.sr-tv__row--fixed p.sr-tv__layer { font-weight: 700; }

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .sr-spine { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .sr-spine .sr-node:nth-of-type(odd)::before,
  .sr-spine .sr-node:nth-of-type(odd)::after { display: none; }

  .sr-nrow { grid-template-columns: 208px minmax(0, 1fr); }

  .sr-fan { grid-template-columns: minmax(0, 1fr); }

  .sr-peak { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  i.sr-pk__op { display: none; }

  .sr-tv__axis,
  .sr-tv__row { grid-template-columns: 210px minmax(0, 1fr); }

  .sr-tv__axis { grid-template-columns: 210px minmax(0, 1fr) minmax(0, 1fr); }
}

@media (max-width: 940px) {
  .sr-fig { padding: 24px 20px 22px; }

  h3.sr-h { font-size: 22px; }

  .sr-spine { grid-template-columns: minmax(0, 1fr); }

  .sr-spine .sr-node::before,
  .sr-spine .sr-node::after { display: none; }

  .sr-stores { grid-template-columns: minmax(0, 1fr); }

  .sr-chunks { grid-template-columns: repeat(8, minmax(0, 1fr)); }

  .sr-nrow {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .sr-travel { padding: 4px 18px 16px; }

  .sr-tv__axis,
  .sr-tv__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .sr-tv__axis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 16px;
  }

  p.sr-tv__corner { display: none; }

  .sr-tv__row { padding: 10px 0; }
}

@media (max-width: 620px) {
  .sr-peak { grid-template-columns: minmax(0, 1fr); }

  .sr-chunks { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
