.pr-brand-alpha { --pad: .5rem; --gap: .25rem; }
.pr-brand-alpha-bar {
  display: flex; flex-wrap: wrap; gap: var(--gap); margin-bottom: .75rem;
}
.pr-brand-alpha-bar .pr-letter {
  border: 1px solid #ddd; background: #f7f7f7; padding: .4rem .55rem;
  border-radius: .5rem; cursor: pointer; line-height: 1; transition: .15s;
}
.pr-brand-alpha-bar .pr-letter:hover { background: #fff; }
.pr-brand-alpha-bar .pr-letter.is-active {
  background: #fff; border-color: #bbb; box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

/* Prevent last row buttons from stretching wider */
.pr-brand-alpha-bar {
    justify-content: center;      /* center rows */
    gap: .35rem;                  /* tighter spacing optional */
}

/* Standardise all letter button sizes */
.pr-brand-alpha-bar .pr-letter {
    flex: 0 0 auto;               /* do NOT stretch */
    width: 40px;                  /* fixed width */
    height: 40px;                 /* fixed height */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    text-align: center;
}

/* Optional: make 0–9 button fit text better */
.pr-brand-alpha-bar .pr-letter[data-letter="0-9"] {
    width: auto;                     /* allow slightly wider */
    padding: 0 .5rem;
}

.pr-brand-alpha-results .pr-loading,
.pr-brand-alpha-results .pr-none { padding: .5rem 0; color: #555; }

.pr-brand-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .35rem .75rem;
}
@media (max-width: 900px) { .pr-brand-list { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 640px) { .pr-brand-list { grid-template-columns: repeat(2,1fr); } }

.pr-brand-item { margin: 0; }
.pr-brand-link { text-decoration: none; border-bottom: 1px dashed transparent; }
.pr-brand-link:hover { border-bottom-color: currentColor; }
.pr-count { opacity: .65; }

/* Grid of logo cards */
.pr-brand-alpha .pr-brand-cards {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important; /* desktop default */
}

/* Tablet-ish */
@media (max-width: 1024px) {
  .pr-brand-alpha .pr-brand-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

/* Small tablets / big phones */
@media (max-width: 900px) {
  .pr-brand-alpha .pr-brand-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* Phones */
@media (max-width: 640px) {
  .pr-brand-alpha .pr-brand-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

.pr-brand-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  background: #fff;
  border: 1px solid #eee;
  border-radius: .75rem;
  padding: .75rem;
  gap: .5rem;
  transition: box-shadow .15s ease, transform .06s ease;
}
.pr-brand-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.06); transform: translateY(-1px); }

/* Fixed-size logo container */
.pr-brand-logo,
.pr-initials-badge {
  width: 120px;          /* adjust as needed */
  height: 120px;         /* adjust as needed */
  background: #fafafa;
  border: 1px solid #f0f0f0;
  border-radius: .6rem;
  display: flex;
  align-items: center;   /* centers logo vertically */
  justify-content: center; /* centers logo horizontally */
  overflow: hidden;
}

/* Make images scale down to fit container, never overflow */
.pr-brand-logo img,
.pr-brand-logo {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Circle variant */
.pr-brand-card.pr-shape-circle .pr-brand-logo,
.pr-brand-card.pr-shape-circle .pr-initials-badge {
  border-radius: 50%;
}

/* Initials fallback still centered */
.pr-initials-badge {
  font-weight: 600;
  font-size: 1.25rem;
  color: #444;
}

.pr-brand-name { color: #222; font-size: .95rem; text-align: center; }
.pr-count { opacity: .65; font-size: .9rem; }

/* Keep your existing list layout styles for when layout="list" and show_logos=false */

/* Fixed-size logo area to keep names aligned */
.pr-brand-card { --logoBox: 120px; } /* adjust once, grid stays neat */

.pr-logo-frame {
  width: var(--logoBox);
  height: var(--logoBox);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  border: 1px solid #f0f0f0;
  border-radius: .6rem;
  overflow: hidden;            /* no spill */
  margin: 0;                   /* ensure consistent baseline */
}

/* Make the actual image fit inside the frame */
.pr-logo-frame .pr-brand-logo {
  max-width: 90%;
  max-height: 90%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;              /* avoid inline-img baseline wiggle */
}

/* Initials fallback sits in the same frame */
.pr-logo-frame .pr-initials-badge,
.pr-initials-badge {           /* keep your existing styles */
  font-weight: 600;
  font-size: 1.25rem;
  color: #444;
}

/* Circle option mirrors the frame shape */
.pr-brand-card.pr-shape-circle .pr-logo-frame { border-radius: 999px; }

