/* Cache state follows the existing miss / hit controls. */
.cache-visual.cache-lab-visual {
  min-width: 0;
  align-self: start;
  padding: 18px 22px 14px;
  border-radius: 12px;
  background:
    radial-gradient(ellipse at 50% 25%, #234b7350, transparent 65%), #152b46;
  box-shadow: inset 0 1px 0 #b9dcff08;
}
.cache-lab-heading {
  letter-spacing: 0.6px;
  color: #91aecb;
  font-size: 8px;
}
.cache-lab-heading > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.cache-lab-heading i,
.cache-lab-policy i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #9bd9ff;
  box-shadow: 0 0 7px #79bfff;
}
.cache-lab-heading > span:last-child {
  color: #f0c78f;
  padding: 5px 7px;
  border: 1px solid #c7a16c30;
  border-radius: 4px;
  background: #c7a16c0d;
  font: 8px var(--mono);
}
.cache-lab-request {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 6px 9px;
  border: 1px solid #5a7a9c35;
  border-radius: 5px;
  background: #11243b60;
  font: 9px var(--mono);
}
.cache-lab-request > span {
  color: #a8daff;
}
.cache-lab-request > code {
  font: inherit;
  color: #a0b8d5;
}
.cache-lab-request > small {
  color: #6787a9;
  font-size: 7px;
  margin-left: auto;
}
.cache-lab-topology {
  position: relative;
  height: 142px;
  margin-top: 5px;
}
.cache-lab-wires {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.cache-lab-wire,
.cache-lab-packet {
  fill: none;
  vector-effect: non-scaling-stroke;
}
.cache-lab-wire {
  stroke: #4b779f;
  stroke-width: 1;
  opacity: 0.65;
}
.cache-lab-packet {
  stroke: #a1d5ff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 5 95;
  filter: drop-shadow(0 0 3px #65b6ff);
  animation: cache-lab-packet 3s linear infinite;
}
.cache-lab-origin-packet {
  animation-delay: -1s;
}
.cache-lab-response-packet {
  stroke: #91e0e6;
  animation-delay: -2s;
}
.cache-lab-endpoint {
  position: absolute;
  top: 29px;
  width: 25%;
  text-align: center;
  transition: opacity 0.35s;
}
.cache-lab-client {
  left: -2.3%;
}
.cache-lab-upstream {
  right: -2.3%;
}
.cache-lab-endpoint > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: 0 auto 7px;
  border: 1px solid #5b85b1;
  border-radius: 9px;
  background: #213d5d;
  box-shadow: 0 6px 14px #0a192d50;
}
.cache-lab-endpoint .icon {
  width: 21px;
  height: 21px;
  color: #a7cdf3;
}
.cache-lab-endpoint strong {
  display: block;
  color: #b4ceeb;
  font: 9px var(--mono);
}
.cache-lab-endpoint small {
  display: block;
  color: #7396ba;
  font-size: 8px;
  margin-top: 4px;
}
.cache-lab-runtime {
  position: absolute;
  left: 50%;
  top: 15px;
  width: 110px;
  transform: translateX(-50%);
  text-align: center;
  padding: 8px 6px;
  border: 1px solid #81bcee;
  border-radius: 9px;
  background: linear-gradient(135deg, #346795, #234465);
  box-shadow:
    0 0 0 5px #6cbbff09,
    0 6px 20px #08182c70;
}
.cache-lab-runtime > span {
  display: block;
  font: 7px var(--mono);
  letter-spacing: 0.8px;
  color: #97c5ea;
}
.cache-lab-runtime .icon {
  display: block;
  margin: 6px auto 5px;
  width: 25px;
  height: 25px;
  color: #c3e6ff;
}
.cache-lab-runtime > strong {
  display: block;
  color: #e1f1ff;
  font: 11px var(--mono);
}
.cache-lab-runtime > small {
  display: block;
  margin-top: 4px;
  color: #8fb6d9;
  font: 7px var(--mono);
}
.cache-lab-response-label,
.cache-lab-fetch-label {
  position: absolute;
  font: 7px var(--mono);
  color: #8baac9;
  padding: 0 4px;
  background: #19334f;
}
.cache-lab-response-label {
  left: 30%;
  top: 103px;
}
.cache-lab-fetch-label {
  right: 11%;
  top: 116px;
}
.cache-lab-storage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.cache-lab-store {
  position: relative;
  border: 1px solid #456d935e;
  border-radius: 6px;
  padding: 8px 10px;
  background: #24456250;
}
.cache-lab-store > div {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #95bde2;
  font: 8px var(--mono);
}
.cache-lab-store .icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
.cache-lab-store i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #8abbe4;
  margin-left: auto;
  animation: cache-lab-storage 2.4s ease-in-out infinite;
}
.cache-lab-store:nth-child(2) i {
  animation-delay: -1.2s;
}
.cache-lab-store strong {
  display: block;
  color: #c6ddf4;
  font-size: 11px;
  font-weight: 500;
  margin-top: 7px;
}
.cache-lab-store small {
  display: block;
  color: #819fbe;
  font-size: 8px;
  margin-top: 3px;
}
.cache-lab-lifecycle {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
.cache-lab-lifecycle li {
  border-top: 2px solid #587d9f80;
  padding-top: 7px;
  color: #a6c5e3;
  text-align: center;
  font-size: 9px;
}
.cache-lab-lifecycle li > span {
  color: #7198be;
  font: 8px var(--mono);
  margin-right: 4px;
}
.cache-lab-lifecycle b {
  font-weight: 400;
}
.cache-lab-visual .cache-lab-caption {
  min-height: 0;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #476b9140;
}
.cache-lab-caption h4 {
  font-size: 13px;
  margin: 0;
  color: #d1e5fa;
}
.cache-lab-caption p {
  font-size: 10px;
  color: #90adca;
  line-height: 1.8;
  margin-top: 5px;
  min-height: 0;
}
.cache-lab-console {
  margin-top: 10px;
  padding: 8px 10px;
  background: #0f223aaa;
  border: 1px solid #4d72974d;
  border-radius: 6px;
}
.cache-lab-console .cache-path {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #afd7ff;
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: 0.2px;
}
.cache-lab-policy {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
  color: #6f91b4;
  font: 7px var(--mono);
}
.cache-lab-policy > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.cache-lab-policy i {
  width: 3px;
  height: 3px;
  opacity: 0.65;
}
.cache-lab-footnote {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #6e8cac;
  font-size: 8px;
  margin-top: 10px;
}
.cache-lab-visual .cache-lab-hit-only {
  display: none;
}
.cache-lab-visual[data-cache="hit"] .cache-lab-hit-only {
  display: inline;
}
.cache-lab-visual[data-cache="hit"] .cache-lab-miss-only {
  display: none;
}
.cache-lab-visual[data-cache="hit"] .cache-lab-heading > span:last-child {
  color: #a9e5ea;
  background: #79c5cb10;
  border-color: #79c5cb40;
}
.cache-lab-visual[data-cache="hit"] .cache-lab-upstream {
  opacity: 0.4;
}
.cache-lab-visual[data-cache="hit"] .cache-lab-origin-wire {
  opacity: 0.2;
  stroke-dasharray: 3 4;
}
.cache-lab-visual[data-cache="hit"] .cache-lab-origin-packet {
  opacity: 0;
}
.cache-lab-visual[data-cache="hit"] .cache-lab-response-wire {
  stroke: #9ce3e8;
  opacity: 1;
}
.cache-lab-visual[data-cache="hit"] .cache-lab-response-label {
  color: #a3e3e7;
}
.cache-lab-visual[data-cache="hit"] .cache-lab-runtime {
  border-color: #99dce7;
  background: linear-gradient(135deg, #336e81, #244664);
}
.cache-lab-visual[data-cache="hit"] .cache-lab-lifecycle li {
  border-color: #75b6c3;
}
@keyframes cache-lab-packet {
  to {
    stroke-dashoffset: -100;
  }
}
@keyframes cache-lab-storage {
  50% {
    opacity: 0.35;
    box-shadow: 0 0 0 3px #8bc6ff10;
  }
}
@media (min-width: 700px) {
  #panel-cache {
    grid-template-columns: 0.85fr 1.15fr;
  }
}
@media (max-width: 1199px) {
  .cache-visual.cache-lab-visual {
    padding: 16px;
  }
  .cache-lab-heading {
    letter-spacing: 0.2px;
    font-size: 7px;
  }
  .cache-lab-heading > span:last-child {
    font-size: 7px;
    padding: 5px;
  }
  .cache-lab-runtime {
    width: 95px;
  }
  .cache-lab-store {
    padding: 9px 8px;
  }
  .cache-lab-store > div {
    font-size: 7px;
    gap: 4px;
  }
  .cache-lab-lifecycle li {
    font-size: 8px;
  }
  .cache-lab-lifecycle li > span {
    display: block;
    margin: 0 0 4px;
  }
}
@media (max-width: 699px) {
  .cache-lab-runtime {
    width: 86px;
  }
  .cache-lab-runtime > span {
    font-size: 6px;
    letter-spacing: 0.5px;
  }
  .cache-lab-runtime > small {
    font-size: 6px;
  }
  .cache-lab-store small {
    font-size: 7px;
  }
  .cache-lab-request {
    gap: 6px;
    padding-inline: 7px;
    font-size: 8px;
  }
  .cache-lab-request > small {
    font-size: 6px;
  }
  .cache-lab-policy {
    font-size: 6px;
    gap: 4px;
  }
  .cache-lab-heading > span:first-child {
    gap: 4px;
  }
  .cache-lab-heading {
    font-size: 6px;
  }
  .cache-lab-heading > span:last-child {
    font-size: 6px;
  }
  .cache-lab-store > div {
    font-size: 6px;
  }
  .cache-lab-endpoint > span {
    width: 35px;
    height: 38px;
  }
  .cache-lab-endpoint .icon {
    width: 18px;
    height: 18px;
  }
  .cache-lab-endpoint strong {
    font-size: 8px;
  }
  .cache-lab-endpoint small {
    font-size: 7px;
  }
  .cache-lab-response-label {
    left: 30%;
    font-size: 6px;
  }
  .cache-lab-fetch-label {
    right: 6%;
    font-size: 6px;
  }
}
