.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 14px !important;
  margin: 2px 4px;
  background: #f5f7fbcc;
  cursor: pointer;
  font-size: 13px !important;
  font-weight: 500;
  transition: all 0.15s cubic-bezier(.41,1.02,.73,.95);
  border: none;
  letter-spacing: 0.03em;
  user-select: none;
  position: relative;
}

.chip:hover,
.chip:focus-visible {
  filter: brightness(1.08);
  outline: none;
  transform: translateY(-1px) scale(1.04);
}

/* X-Symbol */
.chip .chip-close {
  display: none;
  margin-left: 8px;
  font-size: 18px !important;
  font-weight: bold;
  cursor: pointer;
  opacity: 0.6;
  line-height: 1;
  user-select: none;
}

.chip.active .chip-close {
  display: inline;
}

.chip .chip-close:hover {
  opacity: 1;
}

/* Hauptkategorie-Stil */
.chip.main {
  font-size: 14px;
  font-weight: 700;
  border-width: 2.5px;
}

/* Hauptkategorien mit Faded Farben + Farb-Rahmen */
.chip-it.main {
  background: rgba(40,130,255,0.12);
  color: #2882ff;
  border: 2.5px solid #2882ff;
}

.chip-erp.main {
  background: rgba(255,200,0,0.14);
  color: #d49d00;
  border: 2.5px solid #d49d00;
}

.chip-usw.main {
  background: rgba(255,90,40,0.13);
  color: #ff5a28;
  border: 2.5px solid #ff5a28;
}

/* Aktive Hauptkategorien (vollfarbig) */
.chip-it.main.active {
  background: #2882ff;
  color: #fff;
}

.chip-erp.main.active {
  background: #ffc800;
  color: #222;
}

.chip-usw.main.active {
  background: #ff5a28;
  color: #fff;
}

/* Unterkategorien (Faded Look, kein Rahmen) */
.chip-it:not(.main) {
  background: rgba(40,130,255,0.12);
  color: #2882ff;
}

.chip-erp:not(.main) {
  background: rgba(255,200,0,0.14);
  color: #d49d00;
}

.chip-usw:not(.main) {
  background: rgba(255,90,40,0.13);
  color: #ff5a28;
}

/* Aktive Unterkategorien: Vollfarbe + Rahmen */
.chip-it.active:not(.main) {
  background: #2882ff;
  color: #fff;
  border: 2.5px solid #2882ff;
}

.chip-erp.active:not(.main) {
  background: #ffc800;
  color: #222;
  border: 2.5px solid #d49d00;
}

.chip-usw.active:not(.main) {
  background: #ff5a28;
  color: #fff;
  border: 2.5px solid #ff5a28;
}

/* Einheitliches aktives Styling */
.chip.active {
  font-weight: 700;
  z-index: 1;
}

.chip:active {
  filter: brightness(0.96);
  transform: scale(0.97);
}

.chip:focus-visible {
  outline: 2px solid #2882ff77;
  outline-offset: 2px;
}

#chipContainer {
  padding: 3px 0;
  background: transparent;
}

/* Responsiv etwas dichter */
@media (max-width: 768px) {
  .chip {
    padding: 4px 11px;
    font-size: 12.5px;
    margin: 1px 2px;
  }
}