.pdb {
  font-family: var(--ms-font);
  color: var(--ms-ink);
}

.pdb-wrap {
  max-width: var(--ms-max);
  margin: 0 auto;
  padding: 0 var(--ms-gutter) var(--ms-space-7);
}

.pdb-head h1 {
  font-size: 28px;
  line-height: var(--ms-leading-heading);
  margin: var(--ms-space-4) 0 var(--ms-space-3);
}

.pdb-intro {
  color: var(--ms-mute);
  line-height: var(--ms-leading-copy);
  max-width: 42em;
}

/* Filter area: the media listing's ms-list-filter / ms-filter / ms-field /
   ms-select pattern from the shared bundle. Only page-specific deltas here. */
.pdb-filter-block {
  margin-block-start: var(--ms-space-6);
}

.pdb-filters fieldset {
  min-inline-size: 0;
}

/* The legend names the group for assistive tech; the field labels carry
   the visual structure, as on the media listing. */
.pdb-legend {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* On this paper page white fields read as inputs, as they do on the
   listing's white band. */
.pdb-filters .ms-select {
  background: var(--ms-white);
}

/* Sorting is not filtering: push it to the end of the row. */
.pdb-sort {
  margin-inline-start: auto;
}

/* Result count: the listing's divider closes the form, the figure sits
   directly under it, and an orange rule marks an active filter. */
.pdb-count {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--ms-space-1) var(--ms-space-3);
  margin: 0 0 var(--ms-space-5);
  padding-block: var(--ms-space-4);
  padding-inline-start: 0;
  border-inline-start: 0 solid var(--ms-orange);
  line-height: var(--ms-leading-heading);
}

.pdb-count-now {
  font-size: var(--ms-type-list-card);
  font-weight: 900;
}

.pdb-count-total {
  color: var(--ms-mute);
  font-size: var(--ms-type-caption);
}

.pdb-count.is-filtered {
  padding-inline-start: var(--ms-space-3);
  border-inline-start-width: 4px;
}

@media (max-width: 640px) {
  /* Two fields per row instead of the listing's full-width stack: five
     44px selects stacked would push the results off the first screen. */
  .pdb-filters .ms-field {
    flex: 1 1 calc(50% - var(--ms-space-4));
    min-width: 0;
  }
  .pdb-filters .pdb-sort {
    flex-basis: 100%;
    margin-inline-start: 0;
  }
}

.pdb-list {
  display: grid;
  gap: var(--ms-space-5);
}

.pdb-show {
  border: 1px solid var(--ms-line);
  border-radius: var(--ms-radius-square);
  padding: var(--ms-space-5);
}

.pdb-show-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: var(--ms-leading-heading);
}

.pdb-publisher {
  margin: var(--ms-space-1) 0 0;
  color: var(--ms-mute);
  font-size: 14px;
}

.pdb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ms-space-2);
  margin: var(--ms-space-3) 0 0;
}

.pdb-chip {
  border: 1px solid var(--ms-border);
  border-radius: var(--ms-radius-pill);
  padding: 2px 10px;
  font-size: 13px;
}

.pdb-chip[data-band="slow"],
.pdb-chip[data-band="gentle"],
.pdb-chip[data-band="short"] {
  border-color: var(--ms-ink);
}

.pdb-chip[data-band="fast"],
.pdb-chip[data-band="demanding"],
.pdb-chip[data-band="long"] {
  background: var(--ms-paper-soft);
  border-color: var(--ms-border-strong);
}

.pdb-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--ms-space-4);
  margin: var(--ms-space-4) 0 0;
}

.pdb-stats dt {
  color: var(--ms-mute);
  font-size: 13px;
}

.pdb-stats dd {
  margin: var(--ms-space-1) 0 0;
  line-height: var(--ms-leading-copy);
}

.pdb-stats strong {
  font-size: 20px;
}

.pdb-range,
.pdb-note {
  display: block;
  color: var(--ms-mute);
  font-size: 13px;
}

.pdb-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ms-space-2) var(--ms-space-4);
  margin: var(--ms-space-4) 0 0;
}

.pdb-source {
  color: var(--ms-faint);
  font-size: 13px;
  margin: var(--ms-space-2) 0 0;
}

.pdb-episodes {
  margin-top: var(--ms-space-4);
}

.pdb-episodes summary {
  cursor: pointer;
  color: var(--ms-mute);
}

.pdb-table-scroll {
  overflow-x: auto;
  margin-top: var(--ms-space-3);
}

.pdb-table-scroll table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}

.pdb-table-scroll th,
.pdb-table-scroll td {
  border-bottom: 1px solid var(--ms-line);
  padding: 6px 8px;
  text-align: left;
  white-space: nowrap;
}

.pdb-table-scroll td:nth-child(2) {
  white-space: normal;
}

.pdb-empty {
  color: var(--ms-mute);
}

.pdb-method {
  margin-top: var(--ms-space-7);
  max-width: 42em;
  line-height: var(--ms-leading-copy);
}

.pdb-method h2 {
  font-size: 20px;
}

/* Podcast article pages load this stylesheet too: their reading footer
   links here, and the footer's divider follows the CTA pattern. */
.media-system .media-article.page .pdb-link {
  margin-block-end: 20px;
  padding-block-start: 20px;
  font-weight: 700;
}
.media-system .media-article.page .readingFooter:has(> .pdb-link) {
  border-block-start: 1px solid var(--ms-line);
}
