
/* self-hosted-product-analytics figures. This article-local stylesheet loads after resources.css.
   Replaces managed-self-hosted-hybrid-responsibility.svg,
   self-hosted-product-analytics-architecture.svg and product-analytics-tco-model.svg. */

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

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

p.sh-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;
}

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

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

.sh-sw {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.sh-sw--v { background: #dfe7f3; box-shadow: inset 0 0 0 1px #b0bdcd; }
.sh-sw--s { background: repeating-linear-gradient(-45deg, #fdf2dd 0 5px, #f7e6c4 5px 10px); box-shadow: inset 0 0 0 1px #e6cd9a; }
.sh-sw--t { background: #16408f; }
.sh-sw--sub { background: #dfe7f3; box-shadow: inset 0 0 0 1px #b0bdcd; }
.sh-sw--int { background: #16408f; }

/* ---------- figure 1: responsibility matrix ---------- */

.sh-resp {
  padding: 4px 20px 16px;
  border: 1px solid #d7e2f2;
  border-radius: 16px;
  background: #fff;
}

.sh-resp__head,
.sh-resp__row,
.sh-resp__foot {
  display: grid;
  grid-template-columns: 216px repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
}

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

.sh-resp__row { padding: 4px 0; }

.sh-resp__foot {
  margin-top: 8px;
  padding: 12px 0 0;
  border-top: 2px solid #071b3a;
}

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

p.sh-resp__model { text-align: center; }

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

p.sh-own {
  display: grid;
  place-items: center;
  min-height: 34px;
  margin: 0;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-wrap: pretty;
}

.sh-own--v {
  background: #eef2f8;
  box-shadow: inset 0 0 0 1px #dfe7f3;
  color: #4b5b76;
}

.sh-own--s {
  background: repeating-linear-gradient(-45deg, #fdf2dd 0 6px, #fdf9f1 6px 12px);
  box-shadow: inset 0 0 0 1px #e6cd9a;
  color: #6b4e08;
}

.sh-own--t {
  background: #16408f;
  color: #fff;
}

.sh-tally {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.sh-tally__bar {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #16408f;
  box-shadow: 0 0 0 1px #dfe7f3 inset;
}

.sh-tally__bar--s {
  background: linear-gradient(to right, #16408f 0 100%);
}

.sh-tally {
  position: relative;
}

.sh-tally::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  border-radius: 4px;
  background: #eef2f8;
  box-shadow: inset 0 0 0 1px #dfe7f3;
}

.sh-tally__bar { position: relative; }

.sh-tally b {
  font-size: 13px;
  font-weight: 700;
  color: #16408f;
  font-variant-numeric: tabular-nums;
}

/* ---------- figure 2: architecture ---------- */

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

.sh-band {
  padding: 14px 18px 15px;
  border: 1px solid #d7e2f2;
  border-radius: 14px;
  background: #fff;
}

.sh-band--gate { border-left: 5px solid #2f6df6; }
.sh-band--ops { border-left: 5px solid #17693f; }

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

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

.sh-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;
}

.sh-chips__alt {
  background: repeating-linear-gradient(-45deg, #fdf2dd 0 6px, #fdf9f1 6px 12px) !important;
  box-shadow: inset 0 0 0 1px #e6cd9a !important;
  color: #6b4e08 !important;
}

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

.sh-split {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr);
  gap: 12px;
}

.sh-path {
  padding: 14px 16px 16px;
  border: 1px solid #d7e2f2;
  border-radius: 14px;
  background: #fff;
}

.sh-path--replay {
  border-color: #e6cd9a;
  background: #fdf9f1;
}

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

p.sh-path__k em {
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #8a5a06;
}

.sh-steps {
  display: grid;
  gap: 7px;
}

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

.sh-path--replay .sh-step {
  background: #fff;
  box-shadow: inset 0 0 0 1px #e6cd9a;
}

.sh-step--shared {
  background: #eaf1fe;
  box-shadow: inset 0 0 0 1px #c6d9fb;
}

p.sh-step__t {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  color: #071b3a;
}

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

p.sh-shared {
  margin: 0;
  padding: 9px 14px;
  border-radius: 999px;
  background: #eaf1fe;
  box-shadow: inset 0 0 0 1px #c6d9fb;
  font-size: 13px;
  font-weight: 700;
  color: #16408f;
  text-align: center;
}

/* ---------- figure 3: cost allocation + capacity ---------- */

.sh-tco {
  padding: 4px 20px 16px;
  border: 1px solid #d7e2f2;
  border-radius: 16px;
  background: #fff;
}

.sh-tco__head,
.sh-tco__row {
  display: grid;
  grid-template-columns: 236px repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 14px;
}

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

.sh-tco__row { padding: 5px 0; }

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

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

.sh-alloc {
  display: flex;
  gap: 2px;
  height: 28px;
}

.sh-alloc span {
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
}

.sh-alloc__sub {
  background: #eef2f8;
  box-shadow: inset 0 0 0 1px #dfe7f3;
  color: #4b5b76;
}

.sh-alloc__int {
  background: #16408f;
  color: #fff;
}

.sh-cap {
  margin-top: 16px;
  padding: 16px 20px 18px;
  border: 1px solid #d7e2f2;
  border-radius: 16px;
  background: #fff;
}

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

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

.sh-calc {
  display: grid;
  align-content: start;
  padding: 13px 15px 14px;
  border-radius: 12px;
  background: #f4f7fb;
  box-shadow: inset 0 0 0 1px #dfe7f3;
}

.sh-calc--wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  background: #eaf1fe;
  box-shadow: inset 0 0 0 1px #c6d9fb;
}

.sh-calc--wide p.sh-calc__v { margin: 0; }

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

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

p.sh-calc__v {
  margin: 8px 0 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  color: #16408f;
  font-variant-numeric: tabular-nums;
}

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

p.sh-cap__f {
  margin: 13px 0 0;
  padding-top: 12px;
  border-top: 1px solid #e6edf7;
  font-size: 14px;
  line-height: 1.45;
  color: #4b5b76;
  text-wrap: pretty;
}

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

@media (max-width: 1180px) {
  .sh-resp__head,
  .sh-resp__row,
  .sh-resp__foot { grid-template-columns: 168px repeat(4, minmax(0, 1fr)); }

  .sh-tco__head,
  .sh-tco__row { grid-template-columns: 190px repeat(2, minmax(0, 1fr)); }

  .sh-split { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
}

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

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

  .sh-resp { padding: 4px 16px 14px; }

  .sh-resp__head,
  .sh-resp__row,
  .sh-resp__foot {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 8px;
  }

  .sh-resp__row {
    padding: 12px 0;
    border-bottom: 1px solid #eef2f8;
  }

  p.sh-resp__layer,
  .sh-resp__foot p.sh-resp__corner { grid-column: 1 / -1; }

  .sh-resp__head { display: none; }

  p.sh-own::before {
    display: block;
    margin-bottom: 3px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .sh-resp__row p.sh-own:nth-child(2)::before { content: "Managed"; }
  .sh-resp__row p.sh-own:nth-child(3)::before { content: "Self-hosted"; }
  .sh-resp__row p.sh-own:nth-child(4)::before { content: "Warehouse"; }
  .sh-resp__row p.sh-own:nth-child(5)::before { content: "Hybrid"; }

  .sh-tally::after {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #5a6a80;
  }

  .sh-resp__foot .sh-tally:nth-of-type(1)::after { content: "Managed"; }
  .sh-resp__foot .sh-tally:nth-of-type(2)::after { content: "Self-hosted"; }
  .sh-resp__foot .sh-tally:nth-of-type(3)::after { content: "Warehouse"; }
  .sh-resp__foot .sh-tally:nth-of-type(4)::after { content: "Hybrid"; }

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

  .sh-tco__head { display: none; }

  .sh-tco__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 12px 0;
    border-bottom: 1px solid #eef2f8;
  }

  .sh-alloc::before {
    align-self: center;
    flex: none;
    width: 84px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #5a6a80;
  }

  .sh-tco__row .sh-alloc:nth-of-type(1)::before { content: "Managed"; }
  .sh-tco__row .sh-alloc:nth-of-type(2)::before { content: "Self-hosted"; }

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

@media (max-width: 620px) {
  .sh-resp__head,
  .sh-resp__row,
  .sh-resp__foot { grid-template-columns: minmax(0, 1fr); }

  .sh-alloc span {
    padding: 0 4px;
    font-size: 0;
  }

  .sh-alloc span::after {
    font-size: 10.5px;
    line-height: 1;
  }

  .sh-alloc__sub::after { content: "vendor"; }
  .sh-alloc__int::after { content: "team"; }

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

  .sh-calc--wide { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}
