:root {
  --pg-pill-radius: 999px;
}

/* Data rows and map/graph marks retain the shape of the data they represent. */
body button:where(:not(.sm-card, .id-kpi, .notice-item, .result, .chartrow, .gantt, .pin, .pg-chart-project, .sm-district-site)),
body a.btn,
body :is(.pg-demo-contact, .sm-actions) a,
body input:is([type=button], [type=submit], [type=reset]) {
  border-radius: var(--pg-pill-radius) !important;
}

body input:where(:not([type=checkbox], [type=radio], [type=hidden], [type=range], [type=image], .select2-hidden-accessible)),
body select:where(:not(.select2-hidden-accessible)),
body textarea,
body .select2-container .select2-selection {
  box-sizing: border-box;
  max-width: 100%;
  border-radius: var(--pg-pill-radius) !important;
}

/* Leave room for the first glyph at the curved edge of multi-line fields. */
body textarea, body select[multiple]:not(.select2-hidden-accessible) {
  padding: 1rem 1.8rem;
}

body input[type=file]::file-selector-button {
  padding: .4em .85em;
  border-radius: var(--pg-pill-radius);
}

body input:is([type=date], [type=datetime-local], [type=time], [type=month], [type=week]) {
  min-height: 38px;
  min-width: 0;
  padding-inline: 14px 10px;
  font: inherit;
  color-scheme: light;
}

body.dark input:is([type=date], [type=datetime-local], [type=time], [type=month], [type=week]) {
  color-scheme: dark;
}

body .select2-container--default .select2-selection--single .select2-selection__rendered {
  padding-inline: 14px 32px;
}
body .select2-container--default .select2-selection--single .select2-selection__arrow {
  right: 8px;
}

.sm-atlas .sm-toolbar {
  container: pg-map-filters / inline-size;
}

.sm-toolbar .sm-legend {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .45rem;
}

.sm-legend button.sm-key {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "label total" "types total";
  align-content: center;
  align-items: center;
  gap: .2rem .45rem;
  min-width: 0;
  min-height: 3.7rem;
  padding: .55rem 1rem;
}

.sm-key .sm-key-title {
  grid-area: label;
  font-size: .8rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.sm-key .sm-key-types {
  grid-area: types;
  gap: .18rem;
}

.sm-legend .sm-key b {
  grid-area: total;
  min-width: 1ch;
  color: var(--sm-tone, var(--ink));
  background: transparent;
  font-size: clamp(1.55rem, 2vw, 2rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.035em;
  text-align: end;
  font-variant-numeric: tabular-nums;
}

.sm-atlas .sm-count strong {
  font-size: clamp(1.85rem, 2.35vw, 2.3rem);
  line-height: 1;
}

@container pg-map-filters (max-width: 59rem) {
  .sm-toolbar .sm-legend {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@container pg-map-filters (max-width: 29rem) {
  .sm-toolbar .sm-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sm-legend button.sm-key {
    padding-inline: .85rem;
  }
}
@container pg-map-filters (max-width: 15rem) {
  .sm-toolbar .sm-legend {
    grid-template-columns: minmax(0, 1fr);
  }
}
