.pa-public-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.pa-public-preview-heading > h2 {
  min-width: 0;
  margin: 0;
}

.pa-public-legend-open {
  display: inline-flex !important;
  width: auto !important;
  min-width: 0 !important;
  height: 2.5rem !important;
  min-height: 2.5rem !important;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0 0.9rem !important;
  border: 1px solid #315fd4 !important;
  border-radius: 0.5rem !important;
  background: #fff !important;
  color: #315fd4 !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  box-shadow: none !important;
}

.pa-public-legend-open:hover {
  background: #eef4ff !important;
}

.pa-public-legend-open-icon {
  font-size: 1rem;
  line-height: 1;
}

.pa-public-legend-dialog {
  width: min(58rem, calc(100vw - 2rem));
  max-width: none;
  max-height: min(48rem, calc(100vh - 2rem));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0.875rem;
  background: #fff;
  color: #172033;
  box-shadow: 0 1.5rem 4rem rgba(15, 35, 75, 0.22);
}

.pa-public-legend-dialog::backdrop {
  background: rgba(11, 28, 62, 0.48);
  backdrop-filter: blur(1px);
}

.pa-public-legend-shell {
  display: flex;
  max-height: min(48rem, calc(100vh - 2rem));
  flex-direction: column;
}

.pa-public-legend-header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid #dbe3ef;
}

.pa-public-legend-header h2,
.pa-public-legend-item h3 {
  margin: 0;
  color: #172033;
}

.pa-public-legend-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.5;
}

.pa-public-legend-header p {
  margin: 0.25rem 0 0;
  color: #69758a;
  font-size: 0.875rem;
  line-height: 1.5;
}

.pa-public-legend-close {
  display: inline-flex !important;
  width: 2.25rem !important;
  min-width: 2.25rem !important;
  height: 2.25rem !important;
  min-height: 2.25rem !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  border: 1px solid #dbe3ef !important;
  border-radius: 50% !important;
  background: #fff !important;
  color: #526075 !important;
  font-size: 1.5rem !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  box-shadow: none !important;
}

.pa-public-legend-close:hover {
  background: #f4f7fb !important;
}

.pa-public-legend-tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid #dbe3ef;
  background: #f8faff;
}

.pa-public-legend-tab {
  display: inline-flex !important;
  width: auto !important;
  min-width: 6.5rem !important;
  height: 2.5rem !important;
  min-height: 2.5rem !important;
  align-items: center;
  justify-content: center;
  padding: 0 1rem !important;
  border: 1px solid transparent !important;
  border-radius: 0.5rem !important;
  background: transparent !important;
  color: #647087 !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

.pa-public-legend-tab:hover {
  color: #315fd4 !important;
}

.pa-public-legend-tab.is-active {
  border-color: #c8d8fb !important;
  background: #eaf1ff !important;
  color: #2356c8 !important;
}

.pa-public-legend-content {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.pa-public-legend-panel {
  display: none;
  padding: 0.4rem 1.5rem 1.25rem;
}

.pa-public-legend-panel.is-active {
  display: block;
}

.pa-public-legend-guidance {
  margin: 0.75rem 0 0.25rem;
  padding: 0.85rem 1rem;
  border-left: 0.25rem solid #315fd4;
  border-radius: 0.375rem;
  background: #eef4ff;
  color: #30415f;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.6;
  word-break: keep-all;
}

.pa-public-legend-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.5rem;
}

.pa-public-legend-item {
  display: grid;
  grid-template-columns: 4.75rem minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  padding: 1.15rem 0;
  border-bottom: 1px solid #e3e9f2;
}

.pa-public-legend-item h3 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
}

.pa-public-legend-item p {
  margin: 0.35rem 0 0;
  color: #59677d;
  font-size: 0.875rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.pa-public-legend-item small {
  display: block;
  margin-top: 0.45rem;
  color: #315fd4;
  font-size: 0.75rem;
  line-height: 1.5;
}

.pa-public-legend-symbol,
.pa-public-domain-symbol,
.pa-public-connection-symbol {
  position: relative;
  display: flex;
  width: 4.75rem;
  height: 3.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.875rem;
  background: #f7f9fc;
}

.pa-public-legend-symbol.is-domain {
  border: 2.4px solid #25476f;
  background: #fff;
}

.pa-public-legend-symbol.is-component {
  border: 1.7px solid #3f7fb6;
  background: #fff;
}

.pa-public-legend-symbol.is-subcomponent {
  border: 1px solid #748394;
  background: #fff;
}

.pa-public-legend-symbol.is-data {
  width: 3.5rem;
  border: 1.5px solid #0f766e;
  border-radius: 50%;
  background: #ddf7f0;
  justify-self: center;
}

.pa-public-legend-symbol.is-connection span,
.pa-public-connection-symbol span {
  position: relative;
  width: 3.35rem;
  height: 0.125rem;
  background: #ff7a1a;
}

.pa-public-legend-symbol.is-connection span::after,
.pa-public-connection-symbol span::after {
  content: "";
  position: absolute;
  top: -0.3rem;
  right: 0;
  width: 0.65rem;
  height: 0.65rem;
  border-top: 0.125rem solid #ff7a1a;
  border-right: 0.125rem solid #ff7a1a;
  transform: rotate(45deg);
}

.pa-public-domain-symbol {
  border: 2.4px solid #25476f;
  color: #25476f;
  font-size: 0.75rem;
  font-weight: 700;
}

.pa-public-connection-symbol.is-wireless span {
  background: #5b6ef5;
}

.pa-public-connection-symbol.is-wireless span::after {
  border-top-color: #5b6ef5;
  border-right-color: #5b6ef5;
}

.pa-public-connection-symbol.is-internal span {
  background: #9aa3a7;
}

.pa-public-connection-symbol.is-internal span::after {
  border-top-color: #9aa3a7;
  border-right-color: #9aa3a7;
}

@media (max-width: 760px) {
  .pa-public-preview-heading {
    align-items: flex-start;
  }

  .pa-public-legend-open {
    height: 2.25rem !important;
    min-height: 2.25rem !important;
    padding: 0 0.7rem !important;
  }

  .pa-public-legend-dialog {
    width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
  }

  .pa-public-legend-shell {
    max-height: calc(100vh - 1rem);
  }

  .pa-public-legend-header {
    padding: 1rem;
  }

  .pa-public-legend-tabs {
    gap: 0.25rem;
    padding: 0.625rem 1rem;
  }

  .pa-public-legend-tab {
    min-width: 0 !important;
    flex: 1 1 0;
    padding: 0 0.45rem !important;
    font-size: 0.8rem !important;
  }

  .pa-public-legend-panel {
    padding: 0.25rem 1rem 1rem;
  }

  .pa-public-legend-list {
    grid-template-columns: 1fr;
  }

  .pa-public-legend-item {
    grid-template-columns: 4rem minmax(0, 1fr);
    gap: 0.75rem;
  }

  .pa-public-legend-symbol,
  .pa-public-domain-symbol,
  .pa-public-connection-symbol {
    width: 4rem;
  }
}
