.inst-wrap {
  margin: 0 auto;
  padding: 0 1rem;
}

.inst-hero {
  margin-bottom: 1rem;
}

.inst-hero h1 {
  margin: 0 0 .25rem 0;
}

.inst-hero p {
  opacity: .9;
}

.inst-controls {
  display: grid;
  gap: .75rem;
  grid-template-columns: 1fr;
}

.inst-search {
  padding: .75rem 1rem;
  width: 100%;
  border: 1px solid var(--ux-border, rgba(0, 0, 0, .1));
  border-radius: .5rem;
}

.aal-pi-filter-row {
  display: grid;
  grid-template-columns: minmax(76px, auto) 1fr;
  gap: .5rem;
  align-items: start;
}

.aal-pi-filter-label {
  font-size: .86rem;
  font-weight: 700;
  line-height: 1.9;
  opacity: .72;
  text-transform: uppercase;
}

.inst-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.chip {
  border: 1px solid var(--ux-border, rgba(0, 0, 0, .12));
  background: transparent;
  padding: .28rem .5rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: .84rem;
  line-height: 1.2;
}

.chip.is-active {
  border-color: currentColor;
  background: rgba(0, 0, 0, .04);
}

.chip:hover,
.chip:focus-visible {
  border-color: #cc0000;
  outline: none;
}

.inst-meta {
  margin-top: .25rem;
  font-size: .9rem;
  opacity: .8;
}

.inst-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1rem;
}

@media (min-width: 640px) {
  .inst-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .inst-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.inst-card {
  border: 1px solid var(--ux-border, rgba(0, 0, 0, .08));
  border-radius: .75rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.inst-card .inst-hd {
  display: flex;
  align-items: center;
  gap: .5rem;
  justify-content: space-between;
}

.inst-card .pn {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .95rem;
  padding: .2rem .5rem;
  border-radius: .3rem;
  background: rgba(0, 0, 0, .04);
}

.badge {
  font-size: .75rem;
  padding: .18rem .45rem;
  border-radius: .35rem;
  border: 1px solid var(--ux-border, rgba(0, 0, 0, .12));
}

.inst-card .ttl {
  margin: 0;
  line-height: 1.25;
  font-size: 1.05rem;
}

.inst-card .ttl a {
  color: inherit;
  text-decoration: none;
}

.inst-card .ttl a:hover {
  text-decoration: underline;
}

.inst-card .links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.inst-card .btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  border: 1px solid var(--ux-border, rgba(0, 0, 0, .15));
  border-radius: .5rem;
  padding: .5rem .75rem;
  text-decoration: none;
}

.inst-card .btn.ghost {
  background: transparent;
}

.inst-card .btn.small {
  font-size: .9rem;
}

.aal-pi-card-products {
  font-size: .86rem;
  line-height: 1.45;
  color: #555;
}

.aal-pi-card-products span:first-child {
  font-weight: 700;
  color: #333;
}

.aal-pi-sep {
  color: #888;
}

.inst-empty {
  text-align: center;
  padding: 2rem 0;
  opacity: .8;
}

.aal-pi-product-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #f9f9f9;
  margin-top: 12px;
}

.aal-pi-library-button {
  flex-shrink: 0;
  display: inline-block;
  padding: 9px 18px;
  background-color: #cc0000;
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  border-radius: 4px;
  white-space: nowrap;
}

.aal-pi-product-copy {
  font-size: 13px;
  color: #555;
  line-height: 1.4;
}

.aal-pi-product-title {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.25;
  color: #333;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.aal-pi-product-copy p {
  margin: 0;
}

.aal-pi-product-links {
  list-style: none !important;
  margin: 6px 0 0 !important;
  padding-left: 0 !important;
}

.aal-pi-product-links li {
  display: block !important;
  list-style: none !important;
  margin: 0 0 4px !important;
  padding-left: 0 !important;
}

.aal-pi-library-note {
  margin-top: 6px !important;
}

@media (max-width: 640px) {
  .aal-pi-filter-row {
    grid-template-columns: 1fr;
    gap: .35rem;
  }

  .aal-pi-filter-label {
    line-height: 1.3;
  }

  .aal-pi-product-box {
    align-items: flex-start;
    flex-direction: column;
  }
}
