/* The topology and checks use the Workbench palette and share its featured tabs. */
#securebank-lab:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 14px;
}

#securebank-lab .sb-panel {
  min-width: 0;
  margin: 0;
  padding: clamp(12px, 2.4vw, 18px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

#securebank-lab h4 {
  margin: 0 0 4px;
  font-size: 1rem;
}

#securebank-lab .sb-caption {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: .8rem;
}

#securebank-lab .sb-network {
  --sb-path: var(--accent);
  display: grid;
  justify-items: center;
  padding-top: 10px;
  min-width: 0;
}

#securebank-lab .sb-network[data-verdict="block"] { --sb-path: #ffb6a9; }

#securebank-lab .sb-device {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 50px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--soft);
  text-align: center;
  line-height: 1.25;
}

#securebank-lab .sb-device strong { font-size: .83rem; }
#securebank-lab .sb-device span,
#securebank-lab .sb-wire span,
#securebank-lab .sb-paths button span:last-child {
  color: var(--muted);
  font: .72rem/1.3 Consolas, ui-monospace, monospace;
}

#securebank-lab .sb-device[data-state="source"],
#securebank-lab .sb-device[data-state="arrival"],
#securebank-lab .sb-network[data-verdict="block"] [data-node="router"] {
  border-color: var(--sb-path);
}

#securebank-lab .sb-device[data-state="blocked"] { border: 1px dashed var(--sb-path); }
#securebank-lab .sb-core { min-width: 124px; }

#securebank-lab .sb-wire {
  position: relative;
  width: 2px;
  height: 30px;
  background: var(--sb-path);
}

#securebank-lab .sb-wire span {
  position: absolute;
  left: 9px;
  top: 6px;
  white-space: nowrap;
}

#securebank-lab .sb-drop {
  height: 14px;
  background: var(--line);
}

#securebank-lab .sb-branches {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  padding: 0;
  margin: 0;
  list-style: none;
}

#securebank-lab .sb-branches li {
  position: relative;
  min-width: 0;
  padding: 17px 4px 0;
}

#securebank-lab .sb-branches li::before,
#securebank-lab .sb-branches li::after {
  content: "";
  position: absolute;
}

#securebank-lab .sb-branches li::before {
  inset: 0 0 auto;
  border-top: 1px solid var(--line);
}

#securebank-lab .sb-branches li:first-child::before { left: 50%; }
#securebank-lab .sb-branches li:last-child::before { right: 50%; }
#securebank-lab .sb-branches li::after {
  top: 0;
  left: 50%;
  height: 17px;
  border-left: 1px solid var(--line);
}

#securebank-lab .sb-branches li[data-state="source"]::after,
#securebank-lab .sb-branches li[data-state="arrival"]::after { border-color: var(--sb-path); }

#securebank-lab .sb-branches li[data-state="blocked"]::after {
  border-color: var(--sb-path);
  border-style: dashed;
}

#securebank-lab .sb-subnet { overflow-wrap: anywhere; }

#securebank-lab .sb-route {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 8px;
  margin: 0;
  padding-top: 9px;
  color: var(--muted);
  font-size: .82rem;
}

#securebank-lab .sb-route :is(b, strong) { color: var(--sb-path); }
#securebank-lab .sb-paths { display: grid; gap: 5px; margin-top: 10px; }

#securebank-lab .sb-paths button {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 3px 9px;
  min-height: 44px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--soft);
  font: inherit;
  font-size: .83rem;
  text-align: left;
  cursor: pointer;
}

#securebank-lab .sb-paths button:hover,
#securebank-lab .sb-paths [aria-pressed="true"] { border-color: var(--accent); }
#securebank-lab .sb-paths [aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 12%, var(--soft));
}

#securebank-findings .sb-checks {
  width: 100%;
  margin: 12px 0;
  border-collapse: collapse;
  font-size: .85rem;
}

#securebank-findings .sb-checks :is(th, td) {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  overflow-wrap: anywhere;
}

#securebank-findings .sb-checks td:last-child { color: var(--muted); }
#securebank-findings [data-verdict="allow"] td:nth-child(2) { color: var(--accent); }
#securebank-findings [data-verdict="block"] td:nth-child(2) { color: #ffb6a9; }

@media (max-width: 900px) {
  #securebank-lab:not([hidden]) { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  #securebank-lab .sb-network { justify-items: start; }
  #securebank-lab .sb-wire { margin-left: 18px; }
  #securebank-lab .sb-branches {
    grid-template-columns: minmax(0, 1fr);
    padding-left: 18px;
  }

  #securebank-lab .sb-branches li {
    padding: 4px 0 4px 14px;
    border-left: 1px solid var(--line);
  }

  #securebank-lab .sb-branches li::before { display: none; }
  #securebank-lab .sb-branches li::after {
    left: 0;
    top: 50%;
    width: 14px;
    height: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  #securebank-lab .sb-branches .sb-device {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 3px 9px;
    min-height: 35px;
  }
}

/* What Changed pairs the designs and keeps unverified evidence separate. */
#securebank-what-changed :is(h3, h4, p, figure, dl, dd, ul) { margin: 0; }

#securebank-what-changed :is(.wc-section-head, .wc-version-head) {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 12px;
}

#securebank-what-changed > .wc-section-head h3 { font-size: 1.25rem; line-height: 1.25; }

#securebank-what-changed :is(.wc-caption, .wc-status, .wc-slot p) {
  color: var(--muted);
  font-size: .8rem;
}

#securebank-what-changed .wc-compare,
#securebank-what-changed .wc-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#securebank-what-changed .wc-compare { gap: 12px; margin-top: 13px; }

#securebank-what-changed .wc-version {
  min-width: 0;
  padding: clamp(12px, 2vw, 18px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

#securebank-what-changed .wc-kicker {
  color: var(--muted);
  font: .7rem/1.45 Consolas, ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: .1em;
}

#securebank-what-changed .wc-redesign { border-top-color: var(--accent); }
#securebank-what-changed .wc-redesign .wc-kicker { color: var(--accent); }
#securebank-what-changed .wc-version h4 { margin-top: 4px; }
#securebank-what-changed .wc-status strong { color: var(--ink); }

#securebank-what-changed .wc-topology {
  display: grid;
  grid-template-columns: minmax(76px, 1fr) minmax(0, 1.8fr);
  align-items: center;
  gap: 18px;
  min-height: 110px;
  margin: 14px 0 12px;
}

#securebank-what-changed .wc-node {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 43px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--soft);
  font-size: .83rem;
  line-height: 1.25;
}

#securebank-what-changed .wc-node small {
  color: var(--muted);
  font: .72rem/1.3 Consolas, ui-monospace, monospace;
  overflow-wrap: anywhere;
}

#securebank-what-changed .wc-targets {
  position: relative;
  display: grid;
  gap: 7px;
  padding: 0;
  list-style: none;
}

#securebank-what-changed .wc-targets li { position: relative; }

#securebank-what-changed .wc-targets li::before,
#securebank-what-changed .wc-targets::after,
#securebank-what-changed .wc-redesign .wc-targets::before {
  content: "";
  position: absolute;
}

#securebank-what-changed .wc-targets li::before {
  top: 50%;
  left: -10px;
  width: 10px;
  border-top: 1px solid var(--line);
}

#securebank-what-changed .wc-targets::after {
  top: 50%;
  left: -18px;
  width: 8px;
  border-top: 1px solid var(--line);
}

#securebank-what-changed .wc-redesign .wc-targets::before {
  top: 22px;
  bottom: 22px;
  left: -10px;
  border-left: 1px solid var(--line);
}

#securebank-what-changed .wc-design-row { padding: 9px 0; border-top: 1px solid var(--line); }
#securebank-what-changed .wc-design-row dt { font-weight: 600; }
#securebank-what-changed .wc-design-row dd { color: var(--muted); margin-top: 2px; }
#securebank-what-changed .wc-evidence { margin-top: 19px; }
#securebank-what-changed .wc-evidence h4 { font-size: 1rem; line-height: 1.25; }
#securebank-what-changed .wc-evidence details { border-top: 1px solid var(--line); }
#securebank-what-changed .wc-evidence details:first-of-type { margin-top: 8px; }
#securebank-what-changed .wc-evidence summary { min-height: 44px; padding: 10px 0; }
#securebank-what-changed .wc-evidence summary::marker { color: var(--accent); }
#securebank-what-changed .wc-evidence summary span { margin-left: 7px; color: var(--muted); }
#securebank-what-changed .wc-slots { gap: 9px; padding-bottom: 12px; }

#securebank-what-changed .wc-slot {
  min-width: 0;
  padding: 9px 10px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: var(--paper);
}

#securebank-what-changed .wc-slot p { margin-top: 3px; }

@media (min-width: 651px) {
  #securebank-what-changed .wc-version {
    display: grid;
    grid-row: span 5;
    grid-template-rows: subgrid;
    row-gap: 0;
  }

  #securebank-what-changed .wc-version dl { display: contents; }
}

@media (max-width: 650px) {
  #securebank-what-changed :is(.wc-compare, .wc-slots) { grid-template-columns: minmax(0, 1fr); }
  #securebank-what-changed .wc-topology { min-height: 0; }
}

@media (max-width: 620px) {
  #featured[data-project="securebank"] .feature-tabs { flex-wrap: wrap; }
  #featured[data-project="securebank"] .feature-tabs button { flex: 1 1 30%; min-height: 44px; }
}
