/* Multiseleção — clone visual do .training-select + dropdown compacto */

.training-select-wrap.pnv-ms-wrap {
  position: relative;
  flex: 1 1 140px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

button.training-select.pnv-ms-trigger {
  width: 100%;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  padding: 8px 28px 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(99, 102, 241, 0.22);
  background: #fff;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236366f1' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  touch-action: manipulation;
}

button.training-select.pnv-ms-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button.training-select.pnv-ms-trigger:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.pnv-ms-wrap.is-open button.training-select.pnv-ms-trigger {
  border-color: #6366f1;
}

/* Dropdown: absoluto, não altera altura da página */
.pnv-ms-drop {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 60;
  border-radius: 10px;
  border: 1px solid rgba(99, 102, 241, 0.22);
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  box-sizing: border-box;
  overflow: hidden;
}

.pnv-ms-drop-list {
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0;
}

.pnv-ms-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}

.pnv-ms-row:active {
  background: #f1f5f9;
}

.pnv-ms-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: #6366f1;
}

.pnv-ms-row span {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.pnv-ms-drop-foot {
  padding: 6px 8px 8px;
  border-top: 1px solid #e2e8f0;
}

.pnv-ms-clear {
  width: 100%;
  border: none;
  background: transparent;
  color: #6366f1;
  font-size: 12px;
  font-weight: 700;
  padding: 6px;
  cursor: pointer;
  text-align: center;
}

.pnv-ms-clear[hidden] {
  display: none !important;
}

.pnv-ms-empty {
  margin: 0;
  padding: 12px 10px;
  font-size: 12px;
  color: #64748b;
  text-align: center;
}

/* Modal PvP — mesmo padrão, fundo escuro no painel */
.modal-body .pnv-ms-wrap button.training-select.pnv-ms-trigger {
  background-color: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

.modal-body .pnv-ms-drop {
  background: #0f172a;
  border-color: #334155;
  z-index: 120;
}

.modal-body .pnv-ms-row {
  color: #e2e8f0;
}

.modal-body .pnv-ms-row:active {
  background: rgba(99, 102, 241, 0.12);
}

.modal-body .pnv-ms-drop-foot {
  border-color: #334155;
}

@media (max-width: 640px) {
  .training-refine {
    flex-direction: column;
    align-items: stretch;
    max-width: 100%;
    gap: 8px;
  }

  .training-refine .training-select,
  .training-refine .training-select-wrap.pnv-ms-wrap {
    flex: none;
    width: 100%;
    min-width: 0 !important;
  }

  .pnv-ms-drop-list {
    max-height: min(38vh, 220px);
  }
}
