body {
  padding: var(--page-top) 24px 24px;
}
#filter-bar {
  position: sticky;
  top: var(--page-top);
  z-index: 5;
  background: #fafafa;
  margin: 0 -24px 16px;
  padding: 16px 24px 12px 24px;
  border-bottom: 1px solid #eee;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}
.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.filter-label {
  font-size: 12px;
  color: #666;
  margin-right: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pill {
  font: inherit;
  font-size: 12px;
  background: #fff;
  color: #1c1c1c;
  border: 1px solid #ddd;
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
  line-height: 1.4;
}
.pill:hover {
  background: #f0f0f0;
}
.pill.active {
  background: #1c1c1c;
  color: #fff;
  border-color: #1c1c1c;
}
.pill.exclude {
  background: #fff;
  color: #c0392b;
  border-color: #c0392b;
  text-decoration: line-through;
}
.pill.exclude:hover {
  background: #fdecea;
}
#filter-clear {
  font: inherit;
  font-size: 12px;
  background: none;
  border: none;
  color: var(--link-color);
  cursor: pointer;
  padding: 4px 8px;
  text-decoration: underline;
}
#filter-clear:hover {
  background: #f0f0f0;
  border-radius: 4px;
}
#sections h2 {
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 12px;
  color: #1c1c1c;
}
.section-count {
  color: #999;
  font-weight: 400;
  font-size: 14px;
  margin-left: 6px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
}
.flag {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px solid #ddd;
  overflow: hidden;
  cursor: zoom-in;
}
.flag img {
  width: 100%;
  height: 100%;
  display: block;
}
.flag::after {
  content: attr(data-name);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(28, 28, 28, 0.85);
  color: #fff;
  padding: 2px 4px;
  font-size: 10px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  pointer-events: none;
  transition: opacity 80ms;
}
.flag:hover::after {
  opacity: 1;
}
dialog#zoom .country-data {
  margin: 12px 0 0;
  padding: 8px 10px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.4;
  color: #1c1c1c;
  max-height: 40vh;
  overflow: auto;
  white-space: pre;
  user-select: text;
}
