.tapf {
  position: relative;
  display: block;
}

.tapf-preview-note {
  margin: 0 0 .8em;
  padding: .6em .8em;
  border-radius: 6px;
  background: rgba(0,0,0,.05);
  font-size: .95rem;
}

.tapf-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .6em;
  align-items: center;
}

/* "Alle" pill */
.tapf-pill {
  border: 0;
  border-radius: 999px;
  padding: .55em .9em;
  cursor: pointer;
  background: rgba(0,0,0,.06);
  font-weight: 600;
  letter-spacing: .02em;
}

.tapf-pill.is-active,
.tapf-pill[aria-pressed="true"]{
  background: rgba(0,0,0,.12);
}

.tapf-group {
  position: relative;
  display: inline-block;
}

/* Trigger like in screenshot (uppercase + count circle) */
.tapf-trigger {
  background: none;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .55em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .35em .15em;
}

.tapf-trigger__count {
  background: #c9a23f;
  color: #fff;
  border-radius: 999px;
  padding: .28em .55em;
  font-size: .78em;
  line-height: 1;
  min-width: 2.1em;
  text-align: center;
}

.tapf-trigger:focus-visible,
.tapf-pill:focus-visible,
.tapf-close:focus-visible,
.tapf-item:focus-visible {
  outline: 2px solid rgba(0,0,0,.55);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Panel (desktop dropdown) */
.tapf-panel {
  position: absolute;
  top: calc(100% + .7em);
  left: 50%;
  transform: translateX(-50%);
  min-width: 270px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 10px 25px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.05);
  z-index: 9999;
  padding: 1em 1.2em;
}

.tapf-panel::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid #fff;
}

.tapf-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  margin-bottom: .6em;
}

.tapf-panel__title {
  font-weight: 700;
  letter-spacing: .02em;
}

.tapf-close {
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  padding: .1em .25em;
  border-radius: 6px;
}

.tapf-panel__list {
  display: grid;
  gap: .1em;
}

.tapf-item {
  width: 100%;
  border: 0;
  background: none;
  cursor: pointer;
  padding: .45em 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  text-align: left;
  font-size: .98rem;
  color: #6b7b63; /* muted greenish like screenshot */
}

.tapf-item__count {
  color: #8c9b83;
}

.tapf-item:hover {
  color: #3e4a36;
}

/* Status (aria-live) */
.tapf-status {
  margin-top: .5em;
  min-height: 1.2em;
  font-size: .95rem;
  opacity: .85;
}

/* ---------- MOBILE BOTTOM SHEET ---------- */

.tapf-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 9998;
}

.tapf-noscroll {
  overflow: hidden;
}

/* When JS adds .is-sheet, make it a bottom sheet */
.tapf-panel.is-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  transform: none;
  min-width: 0;
  border-radius: 14px 14px 0 0;
  padding: 1em 1.2em 1.2em;
  z-index: 9999;
  max-height: 70vh;
  overflow: auto;
}

.tapf-panel.is-sheet::before {
  display: none;
}

/* small handle bar on sheet */
.tapf-panel.is-sheet .tapf-panel__head::before {
  content: "";
  display: block;
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: rgba(0,0,0,.18);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 8px;
}

.tapf-panel.is-sheet .tapf-panel__head {
  position: sticky;
  top: 0;
  background: #fff;
  padding-top: .9em;
  margin-top: .2em;
  z-index: 1;
}

/* breakpoint (optional, JS also enforces) */
@media (max-width: 860px) {
  .tapf-panel {
    /* JS will add .is-sheet; keep default panel hidden behavior intact */
  }
}
