.homelab-visual {
  width: 100%;
  max-width: 430px;
  min-width: 0;
  padding: 14px 16px;
  color: #dfe4e4;
  font: 12px/1.45 "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-align: left;
}
.homelab-visual:not(.homelab-visual--detail) .homelab-detail-only { display: none; }
.homelab-visual svg { display: block; flex: none; overflow: visible; }
.homelab-platform {
  padding: 12px;
  border: 1px solid #bfc7d32b;
  border-radius: 12px;
  background: radial-gradient(ellipse at 10% 5%,#baa4de0c,transparent 60%),linear-gradient(135deg,#171b25,#0c131b);
  box-shadow: 0 10px 30px #00000024;
}
.homelab-platform-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.homelab-platform-header strong { color: #e8e8ec; font-size: 15px; font-weight: 500; letter-spacing: -.25px; }
.homelab-platform-header > svg { color: #9dabb8; width: 18px; height: 18px; }
.homelab-architecture { display: grid; grid-template-columns: minmax(0,1fr) 44px minmax(0,1fr); margin-top: 12px; }
.homelab-zone { position: relative; min-width: 0; padding: 9px 6px; border: 1px solid; border-radius: 8px; }
.homelab-zone-title { display: block; margin-bottom: 12px; text-align: center; font-size: 12px; font-weight: 500; white-space: nowrap; }
.homelab-core { color: #c6b7dc; border-color: #b5a0d84d; background: linear-gradient(150deg,#b5a0d80e,#b5a0d803); }
.homelab-services { color: #b5ceac; border-color: #a8c49b4d; background: linear-gradient(150deg,#a8c49b0d,#a8c49b03); }
.homelab-core-functions { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0; padding: 0; list-style: none; }
.homelab-core-functions li { display: flex; align-items: center; gap: 12px; min-width: 0; }
.homelab-core-functions svg { width: 19px; height: 19px; }
.homelab-service-zones { display: grid; gap: 5px; }
.homelab-perimeter { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 25px; border: 1px solid #a8c49b35; border-radius: 5px; background: #8fae8007; }
.homelab-perimeter svg { width: 15px; height: 15px; }
.homelab-perimeter > span { font: 10px/1.2 var(--mono,monospace); }
.homelab-firewall { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: #e6bc82; }
.homelab-firewall > svg { position: relative; z-index: 1; width: 30px; height: 50px; }
.homelab-firewall > span { position: relative; z-index: 1; color: #d4b792; font-size: 10px; white-space: nowrap; }
.homelab-firewall .homelab-authorized-flow { position: absolute; z-index: 0; left: -1px; top: calc(50% - 23px); width: calc(100% + 2px); height: 24px; color: #b4d1aa; }
.homelab-flow-line { stroke-dasharray: 3 6; }
.homelab-platform-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 3px 12px; margin-top: 11px; color: #9caeb0; font-size: 11px; }
.homelab-platform-foot > span { display: flex; align-items: center; gap: 5px; }
.homelab-platform-foot svg { width: 12px; height: 12px; color: #a8c49b; }

/* The cloned modal component adds explanations without maintaining another diagram. */
.homelab-visual--detail { max-width: none; padding: 0; font-size: 14px; }
.homelab-visual--detail .homelab-platform { padding: 22px; border-radius: 14px; }
.homelab-visual--detail .homelab-platform-header strong { font-size: 22px; }
.homelab-visual--detail .homelab-platform-header > svg { width: 23px; height: 23px; }
.homelab-visual--detail .homelab-architecture { grid-template-columns: minmax(0,1fr) 102px minmax(0,1.1fr); margin-top: 22px; }
.homelab-visual--detail .homelab-zone { padding: 20px 18px; border-radius: 10px; }
.homelab-visual--detail .homelab-zone-title { margin-bottom: 20px; font-size: 17px; }
.homelab-visual--detail .homelab-core-functions { align-items: stretch; gap: 16px; }
.homelab-visual--detail .homelab-core-functions svg { width: 22px; height: 22px; }
.homelab-visual--detail .homelab-service-zones { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; height: 96px; }
.homelab-visual--detail .homelab-perimeter { flex-direction: column; gap: 11px; border-radius: 8px; border-style: dashed; }
.homelab-visual--detail .homelab-perimeter svg { width: 26px; height: 26px; }
.homelab-visual--detail .homelab-perimeter > span { font-size: 12px; }
.homelab-visual--detail .homelab-firewall > svg { width: 42px; height: 70px; }
.homelab-visual--detail .homelab-firewall > span { font-size: 12px; }
.homelab-visual--detail .homelab-firewall .homelab-authorized-flow { width: calc(100% + 2px); height: 24px; top: calc(50% - 25px); }
.homelab-visual--detail .homelab-platform-foot { margin-top: 18px; font-size: 12px; }
.homelab-visual--detail .homelab-platform-foot svg { width: 14px; height: 14px; }
.homelab-update { margin-top: 24px; }
.homelab-update-heading { display: block; margin: 0 0 14px; color: #d5c4ab; font-size: 14px; font-weight: 500; }
.homelab-update-flow { display: grid; grid-template-columns: minmax(0,1fr) 26px minmax(0,1fr) 26px minmax(0,1fr); gap: 8px; align-items: center; }
.homelab-update-step { min-width: 0; align-self: stretch; padding: 16px; border: 1px solid #d5b4822b; border-radius: 9px; background: linear-gradient(145deg,#a9804610,#a9804603); }
.homelab-update-step > svg { width: 28px; height: 28px; margin-bottom: 12px; color: #d6b684; }
.homelab-update-step strong { display: block; margin-bottom: 6px; color: #ded6c9; font-size: 14px; font-weight: 500; }
.homelab-update-step > span { display: block; color: #a5aaa9; font-size: 12px; line-height: 1.55; }
.homelab-canary { border-color: #d5b48263; background: linear-gradient(145deg,#b38e571a,#a9804605); }
.homelab-update-arrow { width: 26px; height: 20px; color: #bca57f; }
.homelab-failure { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 13px; color: #baa88f; font-size: 12px; }
.homelab-failure > svg { width: 16px; height: 16px; }
.homelab-principle { display: block; margin-top: 15px; color: #8d969d; font-size: 11px; text-align: center; }


@media (max-width:620px) {
  .homelab-visual--detail .homelab-platform { padding: 16px; }
  .homelab-visual--detail .homelab-architecture { grid-template-columns: minmax(0,1fr); margin-top: 16px; }
  .homelab-visual--detail .homelab-zone { padding: 17px; }
  .homelab-visual--detail .homelab-zone-title { margin-bottom: 16px; font-size: 16px; }
  .homelab-visual--detail .homelab-core-functions { width: max-content; max-width: 100%; margin-inline: auto; gap: 13px; }
  .homelab-visual--detail .homelab-firewall { min-height: 82px; flex-direction: row; gap: 14px; }
  .homelab-visual--detail .homelab-firewall > svg { position: absolute; left: calc(50% - 15px); top: calc(50% - 25px); width: 30px; height: 50px; transform: rotate(90deg); }
  .homelab-visual--detail .homelab-firewall > span { position: absolute; left: calc(50% + 32px); top: calc(50% - 14px); background: #101720; padding: 5px 0; }
  .homelab-visual--detail .homelab-firewall .homelab-authorized-flow { left: calc(50% - 41px); top: calc(50% - 12px); width: 82px; height: 24px; transform: rotate(90deg); opacity: .3; }
  .homelab-visual--detail .homelab-platform-foot { justify-content: center; gap: 6px 15px; }
  .homelab-update-flow { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .homelab-update-step { display: grid; grid-template-columns: 28px minmax(0,1fr); align-items: center; column-gap: 14px; padding: 16px; }
  .homelab-update-step > svg { grid-row: 1 / 3; margin: 0; }
  .homelab-update-step > strong, .homelab-update-step > span { grid-column: 2; }
  .homelab-update-arrow { justify-self: center; transform: rotate(90deg); }
  .homelab-failure { align-items: flex-start; justify-content: flex-start; }
  .homelab-failure > svg { margin-top: 2px; }
}
@media (max-width:360px) {
  .homelab-visual { padding-inline: 8px; }
  .homelab-visual--detail { padding: 0; }
}
@media (prefers-reduced-motion:reduce) {
  .homelab-visual .homelab-flow-line { animation: none !important; }
}

/* Card overview: access, maintenance, recovery and monitoring around the cluster. */
.project-infra .infra-visual {
  container: homelab-card / inline-size;
  background: radial-gradient(ellipse at 49% 48%, #26434445, transparent 66%), linear-gradient(140deg, #151622, #0c1119);
}
.homelab-overview { display: block; width: 100%; height: auto; max-height: 100%; flex: none; }
.homelab-overview .ho-flow {
  stroke-dasharray: 6 94;
  stroke-dashoffset: 100;
  animation: homelab-overview-flow 8s linear infinite;
}
.homelab-overview .ho-flow-updates { animation-delay: -2s; }
.homelab-overview .ho-flow-backups { animation-delay: -4s; }
.homelab-overview .ho-flow-monitoring { animation-delay: -6s; }
.homelab-overview .ho-pulse { animation: homelab-overview-pulse 5s ease-in-out infinite; }
.lab-card:not(.in-view) .homelab-overview *,
.is-background .homelab-overview *,
body:has(#case-dialog[open]) .homelab-overview * { animation-play-state: paused; }
@keyframes homelab-overview-flow { to { stroke-dashoffset: 0; } }
@keyframes homelab-overview-pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .homelab-overview .ho-flow { display: none; animation: none !important; }
  .homelab-overview .ho-pulse { animation: none !important; opacity: 1; }
}

@container homelab-card (max-width: 350px) {
  .homelab-overview > g[font-size="23"] { font-size: 26px; }
  .homelab-overview .ho-detail { font-size: 22px; }
}
